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 @@ -12,7 +12,7 @@ jobs:
strategy:
max-parallel: 1 # Run tests sequentially to avoid conflicts on shared mica-demo.obiba.org server
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 @@ -21,11 +21,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 }}
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ coverage
*.sln
*.sw?

# VSCode
.history
__pycache__

debug.py
debug.py
.venv/
.serena/
.agent-sandbox
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]+?))$"
23 changes: 20 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +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: clean build
pip install ./dist/obiba_mica-*.tar.gz

local-install-force: clean build
pip install ./dist/obiba_mica-*.tar.gz --break-system-packages
22 changes: 11 additions & 11 deletions obiba_mica/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from obiba_mica.core import UriBuilder, MicaClient, MicaRequest, MicaResponse
from obiba_mica.rest import RestService
from obiba_mica.file import FileService
from obiba_mica.access import ProjectAccessService, NetworkAccessService, IndividualStudyAccessService, HarmonizationInitiativeAccessService, CollectedDatasetAccessService, HarmonizationProtocolAccessService, FileAccessService
from obiba_mica.perm import ProjectPermissionService, NetworkPermissionService, HarmonizationInitiativePermissionService, HarmonizationProtocolPermissionService, IndividualStudyPermissionService, CollectedDatasetPermissionService
from obiba_mica.import_zip import FileImportService
from obiba_mica.search import SearchService
from obiba_mica.annotation import AnnotationService
from obiba_mica.plugin import PluginService
from obiba_mica.update_collected_dataset import CollectedDatasetService
from obiba_mica.update_collected_datasets import CollectedDatasetsService
from obiba_mica.core import UriBuilder as UriBuilder, MicaClient as MicaClient, MicaRequest as MicaRequest, MicaResponse as MicaResponse
from obiba_mica.rest import RestService as RestService
from obiba_mica.file import FileService as FileService
from obiba_mica.access import ProjectAccessService as ProjectAccessService, NetworkAccessService as NetworkAccessService, IndividualStudyAccessService as IndividualStudyAccessService, HarmonizationInitiativeAccessService as HarmonizationInitiativeAccessService, CollectedDatasetAccessService as CollectedDatasetAccessService, HarmonizationProtocolAccessService as HarmonizationProtocolAccessService, FileAccessService as FileAccessService
from obiba_mica.perm import ProjectPermissionService as ProjectPermissionService, NetworkPermissionService as NetworkPermissionService, HarmonizationInitiativePermissionService as HarmonizationInitiativePermissionService, HarmonizationProtocolPermissionService as HarmonizationProtocolPermissionService, IndividualStudyPermissionService as IndividualStudyPermissionService, CollectedDatasetPermissionService as CollectedDatasetPermissionService
from obiba_mica.import_zip import FileImportService as FileImportService
from obiba_mica.search import SearchService as SearchService
from obiba_mica.annotation import AnnotationService as AnnotationService
from obiba_mica.plugin import PluginService as PluginService
from obiba_mica.update_collected_dataset import CollectedDatasetService as CollectedDatasetService
from obiba_mica.update_collected_datasets import CollectedDatasetsService as CollectedDatasetsService
Loading
Loading