Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actions: publish: fix token #27

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
34 changes: 23 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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={
Expand Down
Loading