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
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ on:
types:
- published

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

name: release

permissions: {}
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ concurrency:
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Install the latest version of uv
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2

- run: make lint

tests:
name: "Python ${{ matrix.python-version }} ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
Expand All @@ -30,15 +44,10 @@ jobs:
with:
persist-credentials: false

- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: "${{ matrix.python-version }}"
allow-prereleases: true

- name: Install the latest version of uv
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2

- name: Run tests for ${{ matrix.python-version }}
run: |
make bootstrap
make test
run: make test
env:
UV_PYTHON: "${{ matrix.python-version }}"
4 changes: 4 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: ["**"]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
Expand Down
7 changes: 2 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ You can run the unit tests locally with:
```bash
# run the test suite in the current environment
make test

# OPTIONAL: use `tox` to fan out across multiple interpreters
make test-all
```

### Documentation
Expand All @@ -70,8 +67,8 @@ Releases of `CacheControl` are managed by GitHub Actions.

To perform a release:

1. Update `CacheControl`'s `__version__` attribute. It can be found under
`cachecontrol/__init__.py`.
1. Update `CacheControl`'s `version` attribute. It can be found
in the `pyproject.toml` file, under the `[project]` section.

1. Create a new tag corresponding to your new version, with a `v` prefix. For example:

Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ VENV=.venv
ACTIVATE = $(VENV)/bin/activate

bootstrap:
uv sync --extra dev
uv sync --dev

lint:
uv run ruff check
uv run mypy cachecontrol
uv run --dev ruff check
uv run --dev mypy cachecontrol

format:
uv run codespell
Expand Down Expand Up @@ -40,10 +40,10 @@ clean-test:
rm -fr htmlcov/

test:
uv run py.test
uv run --dev py.test

coverage:
uv run py.test --cov cachecontrol
uv run --dev py.test --cov cachecontrol

dist: clean
uv build
Expand Down
12 changes: 7 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ Homepage = "https://pypi.org/project/CacheControl/"
Issues = "https://github.com/psf/cachecontrol/issues"
Source = "https://github.com/psf/cachecontrol"

[project.optional-dependencies]
# End-user extras.
filecache = ["filelock >= 3.8.0"]
redis = ["redis>=2.10.5"]

[dependency-groups]
# Development extras.
dev = [
"CacheControl[filecache,redis]",
Expand All @@ -64,6 +60,12 @@ dev = [
"types-requests",
]

[project.optional-dependencies]
# End-user extras.
filecache = ["filelock >= 3.8.0"]
redis = ["redis>=2.10.5"]


[project.scripts]
doesitcache = "cachecontrol._cmd:main"

Expand Down
49 changes: 27 additions & 22 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.