Skip to content
Merged
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
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8.18, 3.10.18, 3.12.11]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4

Expand All @@ -20,11 +20,17 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: pip install poetry
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Install dependencies
run: poetry install -v
run: uv sync --all-extras

# TODO: Re-enable linting once existing code style issues are fixed
# - name: Run linting
# run: uv run ruff check .

- name: Run tests
run: poetry run pytest
run: uv run pytest
18 changes: 10 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.12.11]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4

Expand All @@ -19,17 +19,19 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: pip install poetry
- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: poetry install -v
run: uv sync --all-extras

- name: Run tests
run: poetry run pytest
run: uv run pytest -m "not integration"

- name: Configure PyPI credentials
run: poetry config http-basic.pypi ${{ secrets.PYPI_USER }} ${{ secrets.PYPI_PASSWORD }}
- name: Build package
run: uv build

- name: Publish to PyPI
run: poetry publish --build --no-interaction
run: uv publish
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ coverage
*.sln
*.sw?

# VSCode
.history
__pycache__

debug.py
.history
.venv/
.serena/
plans/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
45 changes: 45 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Ruff configuration file

# Exclude a variety of commonly ignored directories.
extend-exclude = [
"__pycache__",
".git",
".venv",
".eggs",
".nox",
".tox",
".svn",
".hg",
"build",
"dist",
".mypy_cache",
".pytest_cache",
]

# Assume Python 3.10.
target-version = "py310"

# Line length with preview to format
line-length = 120
preview = true

[lint]
# Enable flake8-bugbear rules
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"SIM", # flake8-simplify
]

# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]

# Ignore E501 - long lines in help text are acceptable
ignore = ["E501"]

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
24 changes: 19 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
install:
poetry install
uv sync --all-extras

test:
poetry run pytest
uv run --all-extras pytest

lint:
uv run ruff check .

fix:
uv run ruff check . --fix

format:
uv run ruff format .

check: format fix

build:
poetry build
uv build

clean:
rm -rf dist

local-install:
pip install ./dist/obiba_agate-*.tar.gz
local-install: clean build
pip install ./dist/obiba_agate-*.tar.gz

local-install-force: clean build
pip install ./dist/obiba_agate-*.tar.gz --break-system-packages
338 changes: 0 additions & 338 deletions poetry.lock

This file was deleted.

57 changes: 43 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,52 @@
[tool.poetry]
[project]
name = "obiba-agate"
version = "3.1.0"
description = "OBiBa/Agate python client."
authors = ["Yannick Marcon <yannick.marcon@obiba.org>"]
license = "GPL-v3"
authors = [
{name = "Yannick Marcon", email = "yannick.marcon@obiba.org"}
]
license = {text = "GPL-3.0-only"}
readme = "README.md"
packages = [{include = "obiba_agate"}]
requires-python = ">=3.10"
keywords = ["agate", "obiba", "authentication"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"requests>=2.31.0",
"urllib3>=2.0",
]

[tool.poetry.dependencies]
python = "^3.7"
requests = "^2.31.0"
urllib3 = "1.26.19"
[project.optional-dependencies]
test = [
"pytest>=7.2.2",
]
dev = [
"ruff>=0.10.0",
]

[tool.poetry.group.test.dependencies]
pytest = "^7.2.2"
[project.scripts]
agate = "obiba_agate.console:run"

[tool.poetry.scripts]
agate = 'obiba_agate.console:run'
[project.urls]
Homepage = "https://www.obiba.org"
Repository = "https://github.com/obiba/agate-python-client"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["obiba_agate"]

[tool.pytest.ini_options]
markers = [
"integration: marks tests that require a running Agate instance",
]
Loading
Loading