From 6846bb7cdcaee2dad2ec12f499370f0f257780b9 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Wed, 9 Mar 2022 09:50:40 +0000 Subject: [PATCH] Switch to setup.cfg due to deprecation of setup.py --- .gitlab-ci.yml | 8 ++-- .pre-commit-config.yaml | 7 +++- pyproject.toml | 6 +++ setup.cfg | 74 ++++++++++++++++++++++++++++++++++ setup.py | 88 ----------------------------------------- tox.ini | 3 +- 6 files changed, 93 insertions(+), 93 deletions(-) create mode 100644 pyproject.toml create mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 581a4fe1..9a70b08c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -134,11 +134,13 @@ deploy_production: image: python:3.10-bullseye before_script: - - pip install twine wheel + - python -m pip install --upgrade pip + - python -m pip install --upgrade build + - python -m pip install --upgrade setuptools wheel twine script: - - python setup.py sdist bdist_wheel - - twine upload dist/* + - python -m build + - python -m twine upload dist/* rules: - if: $CI_COMMIT_TAG diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 27dee877..9603f23e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,12 @@ repos: exclude: ^(LICENSE|allianceauth\/static\/css\/themes\/bootstrap-locals.less|allianceauth\/eveonline\/swagger.json|(.*.po)|(.*.mo)) - repo: https://github.com/asottile/pyupgrade - rev: v2.30.0 + rev: v2.31.0 hooks: - id: pyupgrade args: [ --py38-plus ] + + - repo: https://github.com/asottile/setup-cfg-fmt + rev: v1.20.0 + hooks: + - id: setup-cfg-fmt diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..374b58cb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel" +] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..b9fa44b3 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,74 @@ +[metadata] +name = allianceauth +version = attr: allianceauth.__version__ +description = An auth system for EVE Online to help in-game organizations manage online service access. +long_description = file: README.md +long_description_content_type = text/markdown +author = Alliance Auth +author_email = adarnof@gmail.com +license = GPL-2.0 +license_file = LICENSE +classifiers = + Environment :: Web Environment + Framework :: Django + Framework :: Django :: 4 + Intended Audience :: Developers + License :: OSI Approved :: GNU General Public License v2 (GPLv2) + Operating System :: POSIX :: Linux + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Topic :: Internet :: WWW/HTTP :: Dynamic Content', + Topic :: Internet :: WWW/HTTP', +home_page = https://gitlab.com/allianceauth/allianceauth +keywords = + allianceauth + eveonline +project_urls = + Issue / Bug Reports = https://gitlab.com/allianceauth/allianceauth/-/issues + Documentation = https://allianceauth.readthedocs.io/ + +[options] +packages = find: +install_requires = + bcrypt + beautifulsoup4 + celery>=5.2.0,<6.0.0 + celery-once>=3.0.1 + django>=4.0.2,<5.0.0 + django-bootstrap-form + django-celery-beat@git+https://github.com/celery/django-celery-beat.git@0806ab3c65e1615e9b617146779c21f49749067a + django-esi>=4.0.0a1 + django-redis>=5.2.0<6.0.0 + django-registration>=3.2 + django-sortedm2m + dnspython + mysqlclient>=2.1.0 + openfire-restapi + packaging>=21.0,<22 + passlib + pydiscourse + python-slugify>=1.2 + redis>=4.0.0,<5.0.0 + requests>=2.9.1,<3.0.0 + requests-oauthlib + semantic-version + slixmpp +python_requires = ~=3.8 +include_package_data = True +zip_safe = False + +[options.packages.find] +include = allianceauth + +[options.entry_points] +console_scripts = + allianceauth = allianceauth.bin.allianceauth:main + +[options.extras_require] +test = + coverage>=4.3.1 + django-webtest + requests-mock>=1.2.0 diff --git a/setup.py b/setup.py deleted file mode 100644 index aa4e0ed4..00000000 --- a/setup.py +++ /dev/null @@ -1,88 +0,0 @@ -import os -from setuptools import setup -import allianceauth - -this_directory = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f: - long_description = f.read() - -install_requires = [ - 'mysqlclient>=2.1.0', - 'dnspython', - 'passlib', - 'requests>=2.9.1,<3.0.0', - 'bcrypt', - 'python-slugify>=1.2', - 'requests-oauthlib', - 'semantic_version', - 'packaging>=21.0,<22', - 'beautifulsoup4', - - 'redis>=4.0.0,<5.0.0', - 'celery>=5.2.0,<6.0.0', - 'celery_once>=3.0.1', - - 'django>=4.0.2,<5.0.0', - 'django-bootstrap-form', - 'django-registration>=3.2', - 'django-sortedm2m', - 'django-redis>=5.2.0<6.0.0', - 'django-celery-beat @ git+https://github.com/celery/django-celery-beat.git@0806ab3c65e1615e9b617146779c21f49749067a', - - 'openfire-restapi', - 'slixmpp', - 'pydiscourse', - - 'django-esi>=4.0.0a1' -] - -testing_extras = [ - 'coverage>=4.3.1', - 'requests-mock>=1.2.0', - 'django-webtest', -] - -setup( - name='allianceauth', - version=allianceauth.__version__, - author='Alliance Auth', - author_email='adarnof@gmail.com', - description=( - 'An auth system for EVE Online to help in-game organizations ' - 'manage online service access.' - ), - long_description=long_description, - long_description_content_type='text/markdown', - install_requires=install_requires, - extras_require={ - 'testing': testing_extras - }, - python_requires='~=3.8', - license='GPLv2', - packages=['allianceauth'], - url=allianceauth.__url__, - zip_safe=False, - include_package_data=True, - entry_points=""" - [console_scripts] - allianceauth=allianceauth.bin.allianceauth:main - """, - classifiers=[ - 'Environment :: Web Environment', - 'Framework :: Django', - 'Framework :: Django :: 4', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', - ], - project_urls={ - 'Documentation': 'https://allianceauth.readthedocs.io/', - }, -) diff --git a/tox.ini b/tox.ini index b7b68ff9..fcbb0e2c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,5 @@ [tox] +isolated_build = True skipsdist = true usedevelop = true envlist = py{38,39,310,311}-{all,core} @@ -15,7 +16,7 @@ basepython = py311: python3.11 deps= coverage -install_command = pip install -e ".[testing]" -U {opts} {packages} +install_command = pip install -e ".[test]" -U {opts} {packages} commands = all: coverage run runtests.py -v 2 --debug-mode core: coverage run runtests.py allianceauth.authentication.tests.test_app_settings -v 2 --debug-mode