diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0cb6f7a..73da4dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,23 +8,27 @@ on: jobs: tests: name: "Python ${{ matrix.python-version }}" - runs-on: "ubuntu-20.04" - - strategy: - matrix: - python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "pypy3"] + runs-on: "ubuntu-22.04" steps: - uses: "actions/checkout@v2" - - uses: "actions/setup-python@v2" + - uses: "actions/setup-python@v5" with: - python-version: "${{ matrix.python-version }}" + python-version: | + 3.8 + 3.9 + 3.10 + 3.11 + 3.12 + 3.13-dev + pypy3.10 + cache: "pip" - name: "Install dependencies" run: | set -xe python -VV python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade virtualenv tox tox-gh-actions - - name: "Run tox targets for ${{ matrix.python-version }}" - run: "python -m tox" + python -m pip install --upgrade virtualenv tox tox-gh + - name: "Run tox targets" + run: "tox" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e35fbea --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,39 @@ +[project] +name = "pymacaroons" +version = "0.13.0" +description = "Macaroon library for Python" +authors = [ + {name = "Evan Cordell", email = "cordell.evan@gmail.com"}, +] +readme = "README.md" +requires-python = ">=3.8" +dependencies = [ + "six>=1.8.0", + "PyNaCl>=1.1.2,<2.0" +] +classifiers=[ + "Development Status :: 4 - Beta", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "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 :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Security :: Cryptography", + "Topic :: Security", +] +[project.urls] +Documentation = "http://pymacaroons.readthedocs.org/" +Repository = "https://github.com/ecordell/pymacaroons" +Issues = "https://github.com/ecordell/pymacaroons/issues" + +[tool.distutils.bdist_wheel] +universal = true diff --git a/requirements.txt b/requirements.txt index 62afd2c..ff35891 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,6 @@ coverage mock>=2.0.0,<2.99 sphinx>=1.2.3 python-coveralls>=2.4.2 -hypothesis==1.11.4 +hypothesis~=6.0 bumpversion tox -yanc diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 24378bc..0000000 --- a/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[bdist_wheel] -universal=1 - -[metadata] -description-file = README.md diff --git a/setup.py b/setup.py deleted file mode 100644 index 6b3815a..0000000 --- a/setup.py +++ /dev/null @@ -1,51 +0,0 @@ -import os - -from setuptools import find_packages, setup - - -def read_file(*paths): - here = os.path.dirname(os.path.abspath(__file__)) - with open(os.path.join(here, *paths)) as f: - return f.read() - -# Get long_description from index.rst: -long_description = read_file('docs', 'index.rst') -long_description = long_description.strip().split('split here', 2)[1][:-12] - -setup( - name='pymacaroons', - version="0.13.0", - description='Macaroon library for Python', - author='Evan Cordell', - author_email='cordell.evan@gmail.com', - url='https://github.com/ecordell/pymacaroons', - license='MIT', - packages=find_packages(exclude=['tests', 'tests.*']), - include_package_data=True, - long_description=long_description, - install_requires=[ - 'six>=1.8.0', - 'PyNaCl>=1.1.2,<2.0', - ], - classifiers=[ - 'Development Status :: 4 - Beta', - 'Environment :: Web Environment', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - '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 :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Security :: Cryptography', - 'Topic :: Security' - ], -) diff --git a/tests/property_tests/macaroon_property_tests.py b/tests/property_tests/macaroon_property_tests.py index ce889be..4eb1d11 100644 --- a/tests/property_tests/macaroon_property_tests.py +++ b/tests/property_tests/macaroon_property_tests.py @@ -1,17 +1,17 @@ from __future__ import unicode_literals from hypothesis import * -from hypothesis.specifiers import * +from hypothesis.strategies import * from pymacaroons import Macaroon, MACAROON_V1, MACAROON_V2 from pymacaroons.utils import convert_to_bytes -ascii_text_strategy = strategy( - [sampled_from(map(chr, range(0, 128)))] +ascii_text_strategy = text( + characters(codec="ascii") ).map(lambda c: ''.join(c)) -ascii_bin_strategy = strategy(ascii_text_strategy).map( +ascii_bin_strategy = ascii_text_strategy.map( lambda s: convert_to_bytes(s) ) diff --git a/tox.ini b/tox.ini index a9f3a7a..6c0a63b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py35, py36, py37, py38, py39, pypy3, flake8, docs +envlist = py38, py39, py310, py311, py312, py313, pypy3, flake8, docs skip_missing_interpreters=True [testenv] @@ -27,10 +27,10 @@ commands= [gh-actions] python = - 2.7: py27 - 3.5: py35 - 3.6: py36 - 3.7: py37 3.8: py38 3.9: py39 + 3.10: py310 + 3.11: py311 + 3.12: py312 + 3.13: py313 pypy3: pypy3