Просмотр исходного кода

Use setup.cfg for metadata instead of setup.py

Peter Justin 3 лет назад
Родитель
Сommit
0fc9c03e53
2 измененных файлов с 41 добавлено и 53 удалено
  1. 39 3
      setup.cfg
  2. 2 50
      setup.py

+ 39 - 3
setup.cfg

@@ -1,8 +1,44 @@
-[bdist_wheel]
-universal=1
-
 [metadata]
 [metadata]
+name = FlaskBB
+version = attr: flaskbb.__version__
+url = https://flaskbb.org
+project_urls =
+    Documentation = https://flaskbb.readthedocs.io/en/latest/
+    Code = https://github.com/flaskbb/flaskbb
+    Issue Tracker = https://github.com/flaskbb/flaskbb
+license = BSD-3-Clause
 license_file = LICENSE
 license_file = LICENSE
+author = Peter Justin
+author_email = peter.justin@outlook.com
+description = A classic Forum Software in Python using Flask.
+long_description = file: README.md
+long_description_content_type = text/markdown
+platforms = any
+classifiers =
+    Development Status :: 5 - Production/Stable
+    Framework :: Flask
+    Environment :: Web Environment
+    Intended Audience :: Developers
+    Intended Audience :: End Users/Desktop
+    License :: OSI Approved :: BSD License
+    Operating System :: OS Independent
+    Programming Language :: Python :: 3.6
+    Programming Language :: Python :: 3.7
+    Programming Language :: Python :: 3.8
+    Programming Language :: Python :: 3.9
+    Topic :: Internet :: WWW/HTTP :: Dynamic Content
+    Topic :: Software Development :: Libraries :: Python Modules
+
+[options]
+packages = find:
+include_package_data = True
+zip_safe = False
+python_requires = >= 3.6
+# Dependencies are in setup.py for GitHub's dependency graph.
+
+[options.entry_points]
+console_scripts =
+    flaskbb=flaskbb.cli:flaskbb
 
 
 [tool:pytest]
 [tool:pytest]
 addopts =
 addopts =

+ 2 - 50
setup.py

@@ -1,18 +1,9 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
-
 import os
 import os
 
 
-from setuptools import find_packages, setup
-
-
-def read(*parts):
-    here = os.path.abspath(os.path.dirname(__file__))
-    with open(os.path.join(here, *parts), "r") as fp:
-        return fp.read()
+from setuptools import setup
 
 
-
-long_description = read("README.md")
 install_requires = [
 install_requires = [
     "alembic>=1.6.5",
     "alembic>=1.6.5",
     "amqp>=5.0.6",
     "amqp>=5.0.6",
@@ -78,51 +69,12 @@ install_requires = [
     "WTForms-SQLAlchemy>=0.2",
     "WTForms-SQLAlchemy>=0.2",
 ]
 ]
 
 
-
 extras_require = {"postgres": ["psycopg2-binary"]}
 extras_require = {"postgres": ["psycopg2-binary"]}
 
 
 tests_require = ["py", "pytest", "pytest-cov", "cov-core", "coverage"]
 tests_require = ["py", "pytest", "pytest-cov", "cov-core", "coverage"]
 
 
 setup(
 setup(
-    name="FlaskBB",
-    version="2.0.2",
-    url="https://flaskbb.org",
-    project_urls={
-        "Documentation": "https://flaskbb.readthedocs.io/en/latest/",
-        "Code": "https://github.com/flaskbb/flaskbb",
-        "Issue Tracker": "https://github.com/flaskbb/flaskbb",
-    },
-    license="BSD",
-    author="Peter Justin",
-    author_email="peter.justin@outlook.com",
-    description="A classic Forum Software in Python using Flask.",
-    long_description=long_description,
-    long_description_content_type="text/markdown",
-    packages=find_packages(),
-    include_package_data=True,
-    zip_safe=False,
-    platforms="any",
-    entry_points="""
-        [console_scripts]
-        flaskbb=flaskbb.cli:flaskbb
-    """,
-    python_requires=">3.5",
     install_requires=install_requires,
     install_requires=install_requires,
     extras_require=extras_require,
     extras_require=extras_require,
-    tests_require=tests_require,
-    test_suite="tests",
-    classifiers=[
-        "Development Status :: 4 - Beta",
-        "Environment :: Web Environment",
-        "Intended Audience :: Developers",
-        "Intended Audience :: End Users/Desktop",
-        "License :: OSI Approved :: BSD License",
-        "Operating System :: OS Independent",
-        "Programming Language :: Python :: 3.6",
-        "Programming Language :: Python :: 3.7",
-        "Programming Language :: Python :: 3.8",
-        "Programming Language :: Python :: 3.9",
-        "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
-        "Topic :: Software Development :: Libraries :: Python Modules",
-    ],
+    tests_require=tests_require
 )
 )