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
113 changes: 90 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,53 @@ on:
tags:
- "**"
pull_request:
workflow_dispatch:

permissions: {}

env:
PY_COLORS: 1

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# fetch all commits for version computation
fetch-depth: 0
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.15"
- name: Install dependencies
run: python -m pip install -U build
- name: Build
run: python -m build
- name: List distributions
run: ls -lR dist
- name: Save build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: build
path: dist
- name: Install sdist
run: python -m pip install dist/*.tar.gz
- name: Install dependencies
run: python -m pip install -r requirements-test.txt
- name: Test
run: pytest -vv
- name: Test integration files generation
run:
pytest -vv -m generate_integration_files --generate-integration-files --no-cov

tests-py:
name: Test | ${{ matrix.python }}
runs-on: ubuntu-latest
needs:
- build
strategy:
matrix:
python:
Expand All @@ -31,52 +69,79 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: true
- name: Restore build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build
path: dist
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python }}
- name: Install wheel
run: python -m pip install dist/*.whl
- name: Install dependencies
run: pip install tox
- name: Run tests
run: tox run -e py
run: python -m pip install -r requirements-test.txt
- name: Test
run: pytest -vv

tests-misc:
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
env:
- build
- generate-integration-files
- lint
- type
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# build env: fetch all commits for version computation
fetch-depth: ${{ matrix.env == 'build' && '0' || '1' }}
persist-credentials: false
submodules: true
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.15"
- name: Install dependencies
run: pip install tox
- name: Run ${{ matrix.env }}
run: tox run -e ${{ matrix.env }}
- if: ${{ matrix.env == 'build' }}
name: Save ${{ matrix.env }} artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
run: python -m pip install -r requirements-lint.txt
- name: ruff check
run: ruff check
- name: ruff format
run: ruff format --check

type:
name: Type
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Restore build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ matrix.env }}
name: build
path: dist
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.15"
- name: Install dependencies
run: python -m pip install -r requirements-type.txt
- name: Create _version.py
run: echo '__version__ = ""' > src/xz/_version.py
- name: mypy
run: mypy
- name: Install wheel
run: python -m pip install dist/*.whl
- name: Install dependencies
run: python -m pip install -r requirements-test.txt
- name: mypy tests
run: mypy --namespace-packages --explicit-package-bases tests

publish:
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
needs:
- build
- lint
- tests-py
- tests-misc
- type
runs-on: ubuntu-latest
environment: publish
permissions:
Expand All @@ -87,6 +152,8 @@ jobs:
with:
name: build
path: dist
- name: List distributions
run: ls -lR dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ __pycache__
/.coverage
/coverage
/.pytest_cache
/.tox

/src/xz/_version.py
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
".coverage": true,
".mypy_cache": true,
".pytest_cache": true,
".ruff_cache": true,
".tox": true
".ruff_cache": true
},
"editor.detectIndentation": false,
"editor.formatOnSave": true,
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ For the purpose of determining breaking changes:
- Add tests for CPython 3.15 and PyPy 3.12
- Update dev dependencies
- Necessary code changes following dev dependency update: mypy, ruff
- Refactor CI pipeline

## [0.6.0] - 2025-10-18

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ _Leveraging the lzma module for fast (de)compression_

[![GitHub build status](https://img.shields.io/github/actions/workflow/status/rogdham/python-xz/build.yml?branch=master)](https://github.com/rogdham/python-xz/actions?query=branch:master)
[![Release on PyPI](https://img.shields.io/pypi/v/python-xz)](https://pypi.org/project/python-xz/)
[![Code coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)](https://github.com/rogdham/python-xz/search?q=fail+under&type=Code)
[![Code coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)](https://github.com/search?q=repo%3ARogdham%2Fpython-xz+fail_under&type=code)
[![Mypy type checker](https://img.shields.io/badge/type_checker-mypy-informational)](https://mypy.readthedocs.io/)
[![MIT License](https://img.shields.io/pypi/l/python-xz)](https://github.com/Rogdham/python-xz/blob/master/LICENSE.txt)

Expand Down
15 changes: 0 additions & 15 deletions dev-requirements.txt

This file was deleted.

11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ source = "vcs"
directory = "coverage"

[tool.coverage.paths]
source = [
"src/xz/",
".tox/py*/lib/python*/site-packages/xz/",
".tox/py*/site-packages/xz/",
]
source = ["src/xz/"]

[tool.coverage.report]
exclude_lines = [
Expand All @@ -70,6 +66,7 @@ exclude_lines = [
"@overload",
"if TYPE_CHECKING:",
]
fail_under = 100
show_missing = true

[tool.coverage.run]
Expand Down Expand Up @@ -125,6 +122,8 @@ warn_unused_configs = true
[tool.pytest.ini_options]
addopts = """
--cov
--cov-report=html
--cov-report=term-missing
--strict-markers
"""
filterwarnings = ["error"]
Expand All @@ -137,7 +136,7 @@ testpaths = ["tests"]
#

[tool.ruff]
src = ["src"]
src = ["src", "tests"]
target-version = "py311"

[tool.ruff.lint]
Expand Down
5 changes: 5 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-e .

-r requirements-lint.txt
-r requirements-test.txt
-r requirements-type.txt
1 change: 1 addition & 0 deletions requirements-lint.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruff==0.16.10
2 changes: 2 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest==9.1.1
pytest-cov==7.1.0
1 change: 1 addition & 0 deletions requirements-type.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mypy==2.4.0
52 changes: 0 additions & 52 deletions tox.ini

This file was deleted.

Loading