diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3ec7043..ab6b51c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,20 +13,21 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + env: + UV_PYTHON: ${{ matrix.python-version }} steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} + - name: Checkout the repository + uses: actions/checkout@main + - name: Install the default version of uv + id: setup-uv + uses: astral-sh/setup-uv@v3 + - name: Print the installed version + run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}" + - name: Install Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} - name: Install dependencies run: make env - name: Test with pytest run: make test - - name: Publish package - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/Makefile b/Makefile index 1517256..24acd2e 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,8 @@ default: test test: env - .env/bin/pytest -v - -env: .env/.up-to-date - -.env/.up-to-date: setup.py Makefile - python -m venv .env - .env/bin/pip install -e ".[testing]" - touch $@ + uv run --extra testing pytest tests +env: + uv venv + uv pip install -e ".[testing]" diff --git a/forge/__version__.py b/forge/__version__.py index 2b9fae5..8996654 100644 --- a/forge/__version__.py +++ b/forge/__version__.py @@ -1,3 +1,9 @@ -import pkg_resources +import sys +if sys.version_info < (3, 8): + import pkg_resources + get_distribution = pkg_resources.get_distribution +else: + from importlib.metadata import distribution + get_distribution = distribution -__version__ = pkg_resources.get_distribution('pyforge').version +__version__ = get_distribution('pyforge').version diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a53fbf7 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,34 @@ +[build-system] +requires = ["hatchling>=0.25.1", "hatch-vcs"] +build-backend = "hatchling.build" + +[project] +name = "pyforge" +description = "Python mocking framework" +readme = "README.rst" +requires-python = ">=3.8" +license = { text = "BSD 3-Clause License" } + +classifiers = [ + "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", +] +dependencies = ["sentinels>=0.0.4"] +dynamic = ["version"] + +authors = [{ name = "Rotem Yaari", email = "vmalloc@gmail.com" }] + +[project.urls] +"Homepage" = "https://github.com/vmalloc/pyforge" + +[project.optional-dependencies] +testing = ["pytest"] + +[tool.hatch.version] +source = "vcs" + +[tool.hatch.build.targets.wheel] +packages = ["forge"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 9918bd9..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -sentinels>=0.0.4 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 4503c3c..0000000 --- a/setup.cfg +++ /dev/null @@ -1,23 +0,0 @@ -[metadata] -name = pyforge -classifiers = - Intended Audience :: Developers - License :: OSI Approved :: BSD License - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Topic :: Software Development :: Libraries :: Python Modules - Topic :: Software Development :: Testing -summary = Python mocking framework -description-file = - README.rst -description-content-type = text/markdown -license = BSD -author = Rotem Yaari -author_email = vmalloc@gmail.com -url = https://github.com/vmalloc/pyforge - -[extras] -testing = - pytest diff --git a/setup.py b/setup.py deleted file mode 100644 index 7ddc1ba..0000000 --- a/setup.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python -from setuptools import setup - - -setup( - setup_requires=['pbr>=3.0', 'setuptools>=17.1'], - pbr=True, - python_requires=">=3.6.*", - long_description_content_type='text/x-rst; charset=UTF-8', -) diff --git a/tox.ini b/tox.ini index ed51a4c..d219448 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36,py37,py38,py39,py310 +envlist = py38,py39,py310,py311,py312,py313 [testenv] deps=pytest