diff --git a/setup.cfg b/.flake8 similarity index 100% rename from setup.cfg rename to .flake8 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4eae62e8..037dcad0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -41,7 +41,7 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.pyver }} - - run: python setup.py sdist + - run: python -m build - run: pip install dist/localstripe-*.tar.gz - run: python -m localstripe & # Wait for server to be up: diff --git a/README.rst b/README.rst index 4e769c08..4a57539c 100644 --- a/README.rst +++ b/README.rst @@ -242,7 +242,7 @@ To quickly build and run localstripe from source: .. code:: shell - python setup.py sdist + python -m build pip install --user --upgrade dist/localstripe-*.tar.gz localstripe diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..8f4c83eb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,48 @@ +[project] +name = "localstripe" +description = """ +A fake but stateful Stripe server that you can run locally, for \ +testing purposes.""" +readme = {file = "README.rst", content-type = "text/x-rst"} +requires-python = ">=3.8" +license = {text = "GPL-3.0-or-later"} +authors = [{name = "Adrien Vergé"}] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Topic :: Software Development", + "Topic :: Software Development :: Quality Assurance", + "Topic :: Software Development :: Testing", +] +dependencies = [ + "aiohttp >=2.3.2", + "python-dateutil >=2.6.1", +] +dynamic = ["version"] + +[project.optional-dependencies] +dev = [ + "flake8", + "flake8-import-order", +] + +[project.scripts] +localstripe = "localstripe.server:start" + +[project.urls] +homepage = "https://github.com/adrienverge/localstripe" +repository = "https://github.com/adrienverge/localstripe" +documentation = "https://github.com/adrienverge/localstripe" + +[build-system] +build-backend = "setuptools.build_meta" +requires = ["setuptools >= 61"] + +[tool.setuptools] +packages = ["localstripe"] + +[tool.setuptools.package-data] +localstripe = ["localstripe-v3.js"] + +[tool.setuptools.dynamic] +version = {attr = "localstripe.__version__"} diff --git a/setup.py b/setup.py index ba149cc0..9bad74d4 100644 --- a/setup.py +++ b/setup.py @@ -15,25 +15,6 @@ from setuptools import setup -from localstripe import __author__, __version__ - - -setup( - name='localstripe', - version=__version__, - author=__author__, - url='https://github.com/adrienverge/localstripe', - description=('A fake but stateful Stripe server that you can run locally, ' - 'for testing purposes.'), - - packages=['localstripe'], - entry_points={'console_scripts': - ['localstripe=localstripe.server:start']}, - package_data={ - 'localstripe': ['localstripe-v3.js'], - }, - install_requires=[ - 'aiohttp >=2.3.2', - 'python-dateutil >=2.6.1', - ], -) +# This is only kept for backward-compatibility with older versions that don't +# support new packaging standards (e.g. PEP 517 or PEP 660): +setup()