Skip to content
Draft
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
134 changes: 44 additions & 90 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,94 +1,34 @@
version: 2.1

references:
build-docs-checksum-file: &build-docs-checksum-file
run:
name: Build docs checksum file
command: |
declare -a FILES=(
"docs/requirements.txt"
)
for f in ${FILES[@]}
do
echo "# $f" >> docs-requirements.txt
cat $f >> docs-requirements.txt
done

echo "# self" >> docs-requirements.txt
echo "." >> docs-requirements.txt

declare -a FILES=(
"setup.py"
".circleci/requirements.txt"
"docs-requirements.txt"
)
python3 --version >> .docs-checksum
for f in ${FILES[@]}
do
echo "# $f" >> .docs-checksum
cat $f >> .docs-checksum
done
restore-docs-dependencies-cache: &restore-docs-dependencies-cache
restore_cache:
keys:
- deps-2-py<< parameters.version >>-{{ checksum ".docs-checksum" }}
- deps-docs-5-py<< parameters.version >>-{{ checksum "uv.lock" }}
install-docs-dependencies: &install-docs-dependencies
run:
name: Install Dependencies
command: |
python3 -m venv venv
venv/bin/pip install -r .circleci/requirements.txt
venv/bin/pip install -r docs-requirements.txt
uv sync --group docs
save-docs-dependencies-cache: &save-docs-dependencies-cache
save_cache:
key: deps-2-py<< parameters.version >>-{{ checksum ".docs-checksum" }}
key: deps-docs-5-py<< parameters.version >>-{{ checksum "uv.lock" }}
paths:
- venv
build-checksum-file: &build-checksum-file
run:
name: Build checksum file
command: |
declare -a FILES=(
"script/linting/requirements.txt"
"script/typing/requirements.txt"
"script/testing/requirements.txt"
)
for f in ${FILES[@]}
do
echo "# $f" >> all-requirements.txt
cat $f >> all-requirements.txt
done

echo "# self" >> all-requirements.txt
echo "." >> all-requirements.txt

declare -a FILES=(
"setup.py"
".circleci/requirements.txt"
"all-requirements.txt"
)
python3 --version >> .checksum
for f in ${FILES[@]}
do
echo "# $f" >> .checksum
cat $f >> .checksum
done
- .venv
restore-dependencies-cache: &restore-dependencies-cache
restore_cache:
keys:
- deps-2-py<< parameters.version >>-{{ checksum ".checksum" }}
- deps-5-py<< parameters.version >>-{{ checksum "uv.lock" }}
install-dependencies: &install-dependencies
run:
name: Install Dependencies
command: |
python3 -m venv venv
venv/bin/pip install -r .circleci/requirements.txt
venv/bin/pip install -r all-requirements.txt
uv sync
save-dependencies-cache: &save-dependencies-cache
save_cache:
key: deps-2-py<< parameters.version >>-{{ checksum ".checksum" }}
key: deps-5-py<< parameters.version >>-{{ checksum "uv.lock" }}
paths:
- venv
- .venv
parametrised-python-executor: &parametrised-python-executor
parameters:
version:
Expand Down Expand Up @@ -128,35 +68,31 @@ jobs:
steps:
- checkout

- *build-docs-checksum-file
- *restore-docs-dependencies-cache
- *install-docs-dependencies
- *save-docs-dependencies-cache

- run:
name: Build the docs
command: |
source venv/bin/activate
./script/docs/build.sh
uv run ./script/docs/build.sh

lint:
<<: *parametrised-python-executor

steps:
- checkout

- *build-checksum-file
- *restore-dependencies-cache
- *install-dependencies
- *save-dependencies-cache

- run:
name: Run Flake8
command: |
source venv/bin/activate
# Ignore TODOs on CI, for now, even though we do want them
# highlighted in development.
./script/linting/lint --extend-ignore=T000
uv run ./script/linting/lint --extend-ignore T000

test:
<<: *parametrised-python-executor
Expand All @@ -169,60 +105,74 @@ jobs:
command: |
git submodule update --init --recursive

- *build-checksum-file
- *restore-dependencies-cache
- *install-dependencies
- *save-dependencies-cache

- run:
name: Run Tests
command: |
source venv/bin/activate
./run-tests
uv run ./script/testing/test

typecheck:
<<: *parametrised-python-executor

steps:
- checkout

- *build-checksum-file
- *restore-dependencies-cache
- *install-dependencies
- *save-dependencies-cache

- run:
name: Run Mypy
command: |
source venv/bin/activate
./script/typing/check
uv run ./script/typing/check

build:
<<: *parametrised-python-executor

steps:
- checkout

- *restore-dependencies-cache
- *install-dependencies
- *save-dependencies-cache

- run:
name: Build only
command: |
uv run ./script/release/build.sh

- store_artifacts:
path: dist

release:
docker:
- image: cimg/python:3.11
steps:
- checkout

- run:
name: Setup virtualenv
command: |
python3 -m venv venv
venv/bin/pip install -r script/release/requirements.txt
- *install-dependencies

- run:
name: Push to PyPI
command: |
source venv/bin/activate
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=$PYPI_TOKEN
./script/release/release
export UV_PUBLISH_USERNAME=__token__
export UV_PUBLISH_PASSWORD=$PYPI_TOKEN
uv run ./script/release/release

- store_artifacts:
path: dist


workflows:
version: 2.1

validate:
jobs:
- build:
<<: *python-full-version-matrix
- docs:
<<: *python-top-and-bottom-version-matrix
- lint:
Expand All @@ -234,6 +184,9 @@ workflows:

release:
jobs:
- build:
<<: *python-full-version-matrix
<<: *filter-tags
- docs:
<<: *python-top-and-bottom-version-matrix
<<: *filter-tags
Expand All @@ -249,7 +202,8 @@ workflows:
- release:
<<: *filter-tags
requires:
- build
- docs
- test
- lint
- test
- typecheck
6 changes: 0 additions & 6 deletions .circleci/requirements.txt

This file was deleted.

23 changes: 12 additions & 11 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
# .readthedocs.yaml
# Read the Docs configuration file
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
# Per https://docs.readthedocs.com/platform/stable/build-customization.html#install-dependencies-with-uv
pre_create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
create_environment:
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
install:
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

formats:
- pdf
- epub

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt

- method: pip
path: .
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ For tests to work, you will need to clone the `tests/dummy` submodule too:

.. code:: shell

pip install -e .
uv sync

**Run**:
``./run $COMPSTATE``.
Expand Down
5 changes: 0 additions & 5 deletions dev-requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion docs/requirements.txt

This file was deleted.

Loading