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
10 changes: 3 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ jobs:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
pip install --upgrade pip
pip install tox
- name: Run tests
run: |
tox
uv run tox
24 changes: 7 additions & 17 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,9 @@ jobs:

# the checkout action has to be after a newer version of git is installed
# see https://github.com/actions/checkout/issues/335. we need the git directory
# for setuptools-scm to work.
# for hatch-vcs to work.
- uses: actions/checkout@v3

# the setup-python action doesn't work due to the older version of glibc
# see https://github.com/actions/setup-python/issues/1053
- name: Set up Python
run: |
uv python install 3.12
ln -s $(uv python find 3.12) /usr/bin/python
ln -s $(dirname $(uv python find 3.12))/pip /usr/bin/pip

# this is needed when building in docker since the repo is cloned as root.
# must run before the packaging step, which uses git to find tracked files.
# see https://stackoverflow.com/questions/73408170/git-fatal-detected-dubious-ownership
Expand All @@ -41,8 +33,10 @@ jobs:
git config --global --add safe.directory $(pwd)

- name: Run packaging step
env:
UV_PYTHON: "3.12"
run: |
uvx tox -e package
uv run tox -e package

- name: Install GitHub CLI
run: |
Expand All @@ -67,17 +61,13 @@ jobs:
- windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
python-version: "3.12"
- name: Install tox
run: |
pip install --upgrade pip
pip install tox
- name: Run packaging step
run: |
tox -e package
uv run tox -e package
- name: Zip and upload binary
run: |
.github/zip_and_upload_package.sh ${{ runner.os }} ${{ github.event.release.tag_name }}
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@ jobs:
with:
# Tags are needed to compute the current version number
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install tox
- name: Install uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
- name: Build the Python distribution
run: |
pip install --upgrade pip
pip install tox
- name: Publish to PyPI
uv build
- name: Publish the Python distributions to PyPI
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_NON_INTERACTIVE: "true"
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
tox -e release
uv publish
82 changes: 79 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,77 @@
[build-system]
requires = ["setuptools >= 42", "wheel", "setuptools-scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"
requires = ["hatchling>=1,<2", "hatch-vcs>=0.4,<1"]
build-backend = "hatchling.build"

[tool.setuptools_scm]
[project]
name = "isic-cli"
description = "The official command line tool for interacting with the ISIC Archive."
readme = "README.md"
requires-python = ">=3.12"
license = "Apache-2.0"
maintainers = [{ name = "Kitware, Inc.", email = "kitware@kitware.com" }]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"click>=8.2.0",
"django-s3-file-field-client>=1.0.0",
# We expect girder-cli-oauth-client to drop oob support in the future
"girder-cli-oauth-client<1.0.0",
"humanize",
"isic-metadata>=5.0.0",
"more-itertools",
"packaging",
"requests",
"retryable-requests",
"rich",
"sentry-sdk",
"tenacity",
]
dynamic = ["version"]

[project.urls]
Repository = "https://github.com/ImageMarkup/isic-cli"
"Bug Reports" = "https://github.com/ImageMarkup/isic-cli/issues"

[project.scripts]
isic = "isic_cli.cli:main"

[dependency-groups]
dev = [
"ipython",
"tox",
"tox-uv",
]
lint = [
"ruff==0.5.0",
]
type = [
"pyright",
]
test = [
"pytest",
"pytest-lazy-fixtures",
"pytest-mock",
]
package = [
"pyinstaller",
]

[tool.hatch.build]
only-include = [
"isic_cli",
]

[tool.hatch.version]
source = "vcs"

[tool.ruff]
line-length = 100
Expand Down Expand Up @@ -63,3 +132,10 @@ required-imports = ["from __future__ import annotations"]

[tool.ruff.lint.pydocstyle]
convention = "pep257"

[tool.pytest.ini_options]
addopts = [
"--strict-markers",
"--showlocals",
"--verbose",
]
61 changes: 0 additions & 61 deletions setup.py

This file was deleted.

78 changes: 31 additions & 47 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,37 +1,48 @@
[tox]
isolated_build = true
envlist =
lint,
test,
min_version = 4.22
requires =
tox-uv
env_list =
lint
test

[testenv]
runner = uv-venv-lock-runner

[testenv:lint]
skipsdist = true
skip_install = true
deps =
ruff==0.5.0
package = skip
dependency_groups =
lint
commands =
ruff check {posargs:.}
ruff format --check {posargs:.}

[testenv:test]
deps =
pytest
pytest-lazy-fixtures
pytest-mock
[testenv:format]
package = skip
dependency_groups =
lint
commands =
pytest {posargs}
ruff check --fix-only {posargs:.}
ruff format {posargs:.}

[testenv:type]
skipsdist = true
skip_install = true
deps =
pyright
package = skip
dependency_groups =
type
commands =
pyright {posargs:.}

[testenv:test]
dependency_groups =
test
commands =
pytest {posargs}

[testenv:package]
deps =
pyinstaller
# PyInstaller needs the real package files in site-packages, not an editable install
package = wheel
dependency_groups =
package
commands =
pyinstaller \
--clean \
Expand All @@ -44,30 +55,3 @@ commands =
--workpath {env_tmp_dir} \
--collect-all dateutil \
{env_site_packages_dir}/isic_cli/cli/__main__.py

[testenv:format]
skipsdist = true
skip_install = true
deps =
ruff==0.5.0
commands =
ruff check --fix-only {posargs:.}
ruff format {posargs:.}

[testenv:release]
skipsdist = true
skip_install = true
passenv =
TWINE_USERNAME
TWINE_PASSWORD
TWINE_NON_INTERACTIVE
deps =
build
twine
commands =
pyproject-build --sdist --wheel --outdir {envtmpdir}
twine check {envtmpdir}/*
twine upload --skip-existing {envtmpdir}/*

[pytest]
addopts = --strict-markers --showlocals --verbose
Loading
Loading