diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 04e35f9..3660cca 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -21,12 +21,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt - pip install setuptools wheel twine + pip install --upgrade setuptools setuptools-scm wheel twine build - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - python setup.py sdist bdist_wheel + python -m build -nwsx twine upload dist/* diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index d81ce43..977c2a2 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -19,8 +19,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pycodestyle isort pylint yapf - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install --upgrade pycodestyle isort pylint yapf pytest setuptools setuptools-scm wheel build - name: Check pycodestyle run: | pycodestyle --ignore E501,E402 --exclude=.git,dev3 sshpubkeys tests @@ -29,7 +28,7 @@ jobs: pylint sshpubkeys tests - name: Run tests run: | - python3 setup.py test + pytest tests - name: Check formatting run: | isort --recursive sshpubkeys tests; yapf --recursive -i . diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c266e04 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[build-system] +requires = ["setuptools>=61.2", "setuptools_scm[toml]>=3.4.3"] +build-backend = "setuptools.build_meta" + +[project] +name = "sshpubkeys" +authors = [{name = "Olli Jarva", email = "olli@jarva.fi"}] +license = {text = "BSD"} +description = "SSH public key parser" +keywords = ["ssh", "pubkey", "public", "key", "openssh", "ssh-rsa", "ssh-dss", "ssh-ed25519"] +readme = "README.rst" +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Topic :: Security", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python :: 3", + "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 :: Implementation :: PyPy", +] +requires-python = ">=3" +dependencies = ["cryptography>=2.5"] +dynamic = ["version"] + +[project.urls] +Homepage = "https://github.com/ojarva/python-sshpubkeys" + +[project.optional-dependencies] +dev = ["twine", "wheel", "yapf"] + +[tool.setuptools] +packages = ["sshpubkeys"] +include-package-data = false + +[tool.setuptools_scm] + diff --git a/setup.cfg b/setup.cfg index 3c6e79c..b28dd06 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,34 @@ +[metadata] +name = sshpubkeys +author = Olli Jarva +author_email = olli@jarva.fi +license = BSD +description = SSH public key parser +keywords = ssh, pubkey, public, key, openssh, ssh-rsa, ssh-dss, ssh-ed25519 +url = https://github.com/ojarva/python-sshpubkeys +long_description = file: README.rst +classifiers = + Development Status :: 4 - Beta + Intended Audience :: Developers + Intended Audience :: System Administrators + Topic :: Security + License :: OSI Approved :: BSD License + Programming Language :: Python :: 3 + 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 :: Implementation :: PyPy + +[options] +packages = sshpubkeys +install_requires = cryptography>=2.5 +python_requires = >=3 +test_suite = tests + +[options.extras_require] +dev = twine; wheel; yapf + [bdist_wheel] universal=1 diff --git a/setup.py b/setup.py deleted file mode 100644 index b899d48..0000000 --- a/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -from setuptools import setup -from codecs import open as codecs_open -from os import path - -here = path.abspath(path.dirname(__file__)) - -with codecs_open(path.join(here, 'README.rst'), encoding='utf-8') as f: - long_description = f.read() - -setup( - name='sshpubkeys', - version='3.3.1', - description='SSH public key parser', - long_description=long_description, - url='https://github.com/ojarva/python-sshpubkeys', - author='Olli Jarva', - author_email='olli@jarva.fi', - license='BSD', - classifiers=[ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'Topic :: Security', - 'License :: OSI Approved :: BSD License', - 'Programming Language :: Python :: 3', - '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 :: Implementation :: PyPy', - ], - keywords='ssh pubkey public key openssh ssh-rsa ssh-dss ssh-ed25519', - packages=["sshpubkeys"], - test_suite="tests", - python_requires='>=3', - install_requires=['cryptography>=2.5'], - extras_require={ - 'dev': ['twine', 'wheel', 'yapf'], - }, -)