diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 6770e9f..0ef2930 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -22,12 +22,12 @@ jobs: run: | python3 -m pip install --upgrade pip python3 -m pip install setuptools wheel twine - python3 setup.py install + python3 -m pip install . # Build and upload to PyPI - name: "Builds and uploads to PyPI" run: | - python3 setup.py sdist bdist_wheel + python3 -m build python3 -m twine check dist/* python3 -m twine upload dist/* env: diff --git a/.github/workflows/cd_test_pypi.yml b/.github/workflows/cd_test_pypi.yml deleted file mode 100644 index 92c24d0..0000000 --- a/.github/workflows/cd_test_pypi.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow will install Python dependencies and upload a version in the PyPI test environment -name: CD - Test PyPI - -on: - push: - branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - # Sets up python - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - # Install dependencies - - name: "Installs and upgrades pip, installs other dependencies and installs the package from setup.py" - run: | - python3 -m pip install --upgrade pip - python3 -m pip install setuptools wheel twine - python3 setup.py install - - # Upload to TestPyPI - - name: Build and Upload to TestPyPI - run: | - python3 setup.py sdist bdist_wheel - python3 -m twine check dist/* - python3 -m twine upload dist/* - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} - TWINE_REPOSITORY: testpypi diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..1db12d1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[build-system] +requires = ["setuptools >= 61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "mercadopago" +version = "2.2.2" +authors = [ + {name = "Mercado Pago", email = "mp_sdk@mercadopago.com"} +] +description = "Mercadopago SDK module for Payments integration" +readme = "README.md" +keywords = ["api", "mercadopago", "checkout", "payment in sdk integration", lts"] +license = {file = "LICENSE} +requires-python = ">=3.7" +dependencies = [ + "requests" +] +classifiers = [ + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Topic :: Software Development :: Libraries :: Python Modules", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] + +[project.optional-dependencies] +testing = [ + "unittest" +] + +[project.urls] +Homepage = "https://mercadopago.com" +Repository = "https://github.com/mercadopago/sdk-python" \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index a5ab3d0..0000000 --- a/setup.py +++ /dev/null @@ -1,57 +0,0 @@ -""" - Module: setup.py -""" - -import unittest - -from setuptools import ( - find_packages, - setup, -) - - -setup( - name="mercadopago", - version="2.2.2", - description="Mercadopago SDK module for Payments integration", - author="Mercado Pago SDK", - author_email="mp_sdk@mercadopago.com", - url="https://github.com/mercadopago/sdk-python", - license="MIT", - keywords="api mercadopago checkout payment in sdk integration lts", - packages=find_packages(exclude=("tests",)), - include_package_data=True, - long_description=open("README.md").read(), - long_description_content_type="text/markdown", - install_requires=[ - "requests" - ], - tests_require=[ - "unittest" - ], - python_requires=">=3", - cmdclass={"test": unittest}, - project_urls={ - "Source Code": "https://github.com/mercadopago/sdk-python", - "Documentation | EN": "https://www.mercadopago.com.br/developers/en/reference/", - "Documentation | ES": "https://www.mercadopago.com.br/developers/es/reference/", - "Documentation | PT-BR": "https://www.mercadopago.com.br/developers/pt/reference/", - }, - classifiers=[ - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Topic :: Software Development :: Libraries :: Python Modules", - "License :: Freely Distributable", - ], -)