diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 0ef620a..99be0f4 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -13,19 +13,19 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v3 - - name: Set up Python $${{ matrix.python-version }} - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip - python setup.py install pip install pytest + python setup.py install - name: Test with pytest run: | pytest diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index dc70b8b..e30861b 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -29,4 +29,4 @@ jobs: uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }}thu + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/setup.py b/setup.py index fcb5742..ae153d9 100644 --- a/setup.py +++ b/setup.py @@ -8,14 +8,24 @@ version_py = os.path.join(os.path.dirname(__file__), 'src', 'SnmpLibrary', 'version.py') + +def git_pep440_version(): + full = subprocess.check_output( + ['git', 'describe', '--tags', '--always', '--dirty=.dirty'], + stderr=subprocess.STDOUT).decode().strip() + tag = subprocess.check_output( + ['git', 'describe', '--tags', '--always', '--abbrev=0'], + stderr=subprocess.STDOUT).decode().strip() + tail = full[len(tag):] + return tag + tail.replace('-', '.dev', 1).replace('-', '+', 1) + + try: - version = subprocess.check_output( - ['git', 'describe', '--tags', '--always', '--dirty'], - stderr=subprocess.STDOUT).rstrip().decode('ascii') + version = git_pep440_version() with open(version_py, 'w') as f: f.write('# This file was autogenerated by setup.py\n') f.write('__version__ = \'%s\'\n' % (version,)) -except (OSError, IOError, subprocess.CalledProcessError) as e: +except (OSError, subprocess.CalledProcessError, IOError): try: with open(version_py, 'r') as f: d = dict() @@ -64,18 +74,20 @@ def main(): 'Framework :: Robot Framework', 'License :: OSI Approved :: Apache Software License', 'Operating System :: OS Independent', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - '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 :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'Topic :: Software Development :: Testing', ], packages=['SnmpLibrary'], install_requires=[ 'robotframework', - 'pysnmp', + 'pysnmp==4.4.12', + 'pyasn1==0.4.4', ], cmdclass={