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

Use pyproject.toml #28

Closed
wants to merge 5 commits into from
Closed
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
23 changes: 12 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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]"
vmalloc marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 8 additions & 2 deletions forge/__version__.py
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" }]

[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"]
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

23 changes: 0 additions & 23 deletions setup.cfg

This file was deleted.

10 changes: 0 additions & 10 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py36,py37,py38,py39,py310
envlist = py38,py39,py310,py311,py312,py313

[testenv]
deps=pytest
Expand Down
Loading