diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5374b2c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[project] +name = "RandomWords" +version = "0.4.0" +description = "A useful module for a random text, e-mails and lorem ipsum." +readme = "README.rst" +classifiers = [ + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Natural Language :: English", + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Topic :: Software Development :: Libraries :: Python Modules" +] +dependencies = [] +license = {file = "LICENSE.txt"} + +[[project.authors]] +name = "Tomek Święcicki" +email = "tomislater@gmail.com" + +[project.urls] +homepage = "https://github.com/tomislater/RandomWords" + +[tool.setuptools] +packages = [ "random_words" ] diff --git a/setup.py b/setup.py index 266d812..5995cac 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,14 @@ import sys from setuptools import setup -from setuptools.command.test import test as TestCommand +try: + from setuptools.command.test import test as TestCommand +except ImportError: + # setuptools.command.test has been removed. + # The `setup` call is only necessary when defining this `cmdclass`, since + # building the project is no longer dependend on that. + # Therefore, there's no more to do here. + sys.exit() class PyTest(TestCommand): @@ -18,34 +25,10 @@ def run_tests(self): sys.exit(errcode) +# Use `PyTest` as a `cmdclass`. setup( - name='RandomWords', - version='0.4.0', - author='Tomek Święcicki', - author_email='tomislater@gmail.com', - packages=['random_words'], - url='https://github.com/tomislater/RandomWords', - license='LICENSE.txt', - description='A useful module for a random text, e-mails and lorem ipsum.', - long_description=open('README.rst').read(), - classifiers=[ - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python', - 'Natural Language :: English', - 'Development Status :: 5 - Production/Stable', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Topic :: Software Development :: Libraries :: Python Modules', - ], - include_package_data=True, - install_requires=[], tests_require=['pytest'], cmdclass={'test': PyTest}, test_suite='random_words.test.test_random_words', - extras_require={ - 'testing': ['pytest'], - }, + extras_require={ 'testing': ['pytest'] } )