Skip to content

Commit d75e02b

Browse files
Begin fixing workflows
1 parent 9844e08 commit d75e02b

File tree

7 files changed

+50
-196
lines changed

7 files changed

+50
-196
lines changed

.github/workflows/constraints.txt

-5
This file was deleted.

.github/workflows/tests.yml

+20-129
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: Tests
22

33
on:
4-
push:
5-
branches:
6-
- master
74
pull_request:
8-
branches:
9-
- master
5+
types: [opened, reopened, synchronize]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
1010

1111
jobs:
1212
tests:
@@ -17,9 +17,9 @@ jobs:
1717
matrix:
1818
include:
1919
- { python: "3.12", os: "ubuntu-latest", session: "pre-commit" }
20-
- { python: "3.12", os: "ubuntu-latest", session: "mypy" }
21-
- { python: "3.11", os: "ubuntu-latest", session: "mypy" }
22-
- { python: "3.10", os: "ubuntu-latest", session: "mypy" }
20+
# - { python: "3.12", os: "ubuntu-latest", session: "mypy" }
21+
# - { python: "3.11", os: "ubuntu-latest", session: "mypy" }
22+
# - { python: "3.10", os: "ubuntu-latest", session: "mypy" }
2323
- { python: "3.12", os: "ubuntu-latest", session: "tests" }
2424
- { python: "3.11", os: "ubuntu-latest", session: "tests" }
2525
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
@@ -34,135 +34,26 @@ jobs:
3434
- { python: "3.10", os: "macos-13", session: "tests" }
3535
- { python: "3.12", os: "ubuntu-latest", session: "docs-build" }
3636

37-
env:
38-
NOXSESSION: ${{ matrix.session }}
39-
FORCE_COLOR: "1"
40-
PRE_COMMIT_COLOR: "always"
41-
4237
steps:
43-
- name: Check out the repository
38+
- name: Check out the repo
4439
uses: actions/checkout@v4
4540

46-
- name: Set up Python ${{ matrix.python }}
47-
uses: actions/setup-python@v5
41+
- name: Install a specific version of uv
42+
uses: astral-sh/setup-uv@v3
4843
with:
49-
python-version: ${{ matrix.python }}
50-
51-
- name: Upgrade pip
52-
run: |
53-
pip install --constraint=.github/workflows/constraints.txt pip
54-
pip --version
55-
56-
- name: Upgrade pip in virtual environments
57-
shell: python
58-
run: |
59-
import os
60-
import pip
44+
version: "0.4.24"
45+
enable-cache: true
6146

62-
with open(os.environ["GITHUB_ENV"], mode="a") as io:
63-
print(f"VIRTUALENV_PIP={pip.__version__}", file=io)
47+
- name: Install python ${{ matrix.python }} using uv
48+
run: uv python install ${{ matrix.python }}
6449

65-
- name: Install Poetry
66-
run: |
67-
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
68-
poetry --version
69-
70-
- name: Install Nox
71-
run: |
72-
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox
73-
pipx inject --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox nox-poetry
74-
nox --version
50+
- name: Install dependencies # TODO: which extras to install?
51+
run: uv sync
7552

7653
- name: Install pandoc
7754
if: matrix.session == 'docs-build'
7855
uses: pandoc/actions/setup@v1
7956

80-
- name: Compute pre-commit cache key
81-
if: matrix.session == 'pre-commit'
82-
id: pre-commit-cache
83-
shell: python
84-
run: |
85-
import hashlib
86-
import sys
87-
88-
python = "py{}.{}".format(*sys.version_info[:2])
89-
payload = sys.version.encode() + sys.executable.encode()
90-
digest = hashlib.sha256(payload).hexdigest()
91-
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8])
92-
93-
print("::set-output name=result::{}".format(result))
94-
95-
- name: Restore pre-commit cache
96-
uses: actions/cache@v4
97-
if: matrix.session == 'pre-commit'
98-
with:
99-
path: ~/.cache/pre-commit
100-
key: ${{ steps.pre-commit-cache.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }}
101-
restore-keys: |
102-
${{ steps.pre-commit-cache.outputs.result }}-
103-
104-
- name: Run Nox
105-
run: |
106-
nox --python=${{ matrix.python }}
107-
108-
- name: Upload coverage data
109-
if: always() && matrix.session == 'tests'
110-
uses: actions/upload-artifact@v4
111-
with:
112-
name: coverage-data-${{ matrix.os }}-${{ matrix.python }}
113-
include-hidden-files: true
114-
path: ".coverage.*"
115-
116-
- name: Upload documentation
117-
if: matrix.session == 'docs-build'
118-
uses: actions/upload-artifact@v4
119-
with:
120-
name: docs
121-
path: docs/_build
122-
123-
coverage:
124-
runs-on: ubuntu-latest
125-
needs: tests
126-
steps:
127-
- name: Check out the repository
128-
uses: actions/checkout@v4
129-
130-
- name: Set up Python
131-
uses: actions/setup-python@v5
132-
with:
133-
python-version: "3.12"
134-
135-
- name: Upgrade pip
136-
run: |
137-
pip install --constraint=.github/workflows/constraints.txt pip
138-
pip --version
139-
140-
- name: Install Poetry
141-
run: |
142-
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
143-
poetry --version
144-
145-
- name: Install Nox
146-
run: |
147-
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox
148-
pipx inject --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox nox-poetry
149-
nox --version
150-
151-
- name: Download coverage data
152-
uses: actions/download-artifact@v4
153-
with:
154-
pattern: coverage-data-*
155-
merge-multiple: true
156-
157-
- name: Combine coverage data and display human readable report
158-
run: |
159-
nox --session=coverage
160-
161-
- name: Create coverage report
162-
run: |
163-
nox --session=coverage -- xml -i
164-
165-
- name: Upload coverage report
166-
uses: codecov/codecov-action@v4
167-
with:
168-
token: ${{ secrets.CODECOV_TOKEN }}
57+
- name: Run pytest
58+
if: matrix.session == 'tests'
59+
run: uv run pytest -m 'not benchmark_suite'

docs/conf.py

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"sphinx.ext.viewcode",
1919
"matplotlib.sphinxext.plot_directive",
2020
"nbsphinx",
21-
"sphinx_click",
2221
"sphinx_copybutton",
2322
"sphinxext.opengraph",
2423
]

docs/installation.rst

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ efficiently generate a conforming triangular mesh.
1616
are used to aid finite element computations, while
1717
`matplotlib <https://github.com/matplotlib/matplotlib>`_ and
1818
`rich <https://github.com/Textualize/rich>`_ are used for post-processing.
19-
Finally, `click <https://github.com/pallets/click>`_ is used to power the
20-
``sectionproperties`` CLI.
2119

2220
``sectionproperties`` and all of its dependencies can be installed through the python
2321
package index:

0 commit comments

Comments
 (0)