Skip to content

Commit eae96b3

Browse files
authored
switch to uplot, py310 (#362)
* switch to uplot, py310 * who uses mac anyway * update distribute and test workflows * add newer py versions requirements * uv pytest * install * no use binary * uv v5 * use venvs * dont need the uv install * dont failf ast * set python version * try mac with different python version * no py3.13 * add macos * fix tests * activate windows * drop py3.12 * fetch tags * editable install * _ * linting * update linting workflow * use astral action * update ruff config * update examples to uplot / lint
1 parent b974037 commit eae96b3

36 files changed

+6459
-1078
lines changed

.github/workflows/lint.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ jobs:
55
format:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v3
9-
- uses: actions/setup-python@v4
8+
- uses: actions/checkout@v4
9+
- uses: actions/setup-python@v5
1010
with:
11-
python-version: "3.9"
12-
- run: python -m pip install ruff
13-
- run: ruff check .
11+
python-version: "3.10"
12+
- uses: astral-sh/ruff-action@v3

.github/workflows/pin_requirements.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,32 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
os: [ubuntu-latest, windows-latest, macOS-latest]
13-
python-version: ["3.9"]
12+
os: [ubuntu-latest, macos-latest, windows-latest]
13+
python-version: ["3.10", "3.11", "3.12"]
1414
steps:
1515
- name: Checkout code
1616
uses: actions/checkout@v3
1717

18-
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v4
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v3
2020
with:
21-
python-version: ${{ matrix.python-version }}
22-
23-
- name: Install pip-tools
24-
run: pip install pip-tools
21+
# Install a specific version of uv.
22+
version: "0.5.4"
2523

2624
- name: Generate requirements file
27-
run: pip-compile --extra web --output-file requirements-${{ matrix.os }}-${{ matrix.python-version }}.txt pyproject.toml
25+
run: uv pip compile --all-extras --python-version ${{ matrix.python-version }} pyproject.toml -o requirements-${{ matrix.os }}-${{ matrix.python-version }}.txt
2826

2927
- name: Upload requirements file
30-
uses: actions/upload-artifact@v3
28+
uses: actions/upload-artifact@v4
3129
with:
32-
name: requirements
30+
name: req-artifact-${{ matrix.os }}-${{ matrix.python-version }}
3331
path: requirements-${{ matrix.os }}-${{ matrix.python-version }}.txt
34-
32+
merge:
33+
runs-on: ubuntu-latest
34+
needs: generate-requirements
35+
steps:
36+
- name: Merge Artifacts
37+
uses: actions/upload-artifact/merge@v4
38+
with:
39+
name: all-requirements
40+
pattern: req-artifact-*

.github/workflows/pypi_main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
uses: actions/checkout@v3
1212
with:
1313
fetch-depth: 0
14-
- name: Set up Python 3.9
14+
- name: Set up Python 3.10
1515
uses: actions/setup-python@v4
1616
with:
17-
python-version: 3.9
17+
python-version: "3.10"
1818
- name: Install Hatch
1919
run: pip install hatch
2020
- name: Build

.github/workflows/pypi_test.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,37 @@ jobs:
1111
uses: actions/checkout@v3
1212
with:
1313
fetch-depth: 0
14-
- name: Set up Python 3.9
14+
15+
- name: Set up Python 3.10
1516
uses: actions/setup-python@v4
1617
with:
17-
python-version: 3.9
18+
python-version: "3.10"
19+
20+
- name: Configure Git
21+
run: |
22+
git config --global user.email "[email protected]"
23+
git config --global user.name "GitHub Actions"
24+
25+
- name: Create test version tag
26+
run: |
27+
# Get number of commits in current branch
28+
COMMIT_COUNT=$(git rev-list --count HEAD)
29+
# Get short SHA
30+
SHA=$(git rev-parse --short HEAD)
31+
# Create a PEP 440 compliant version number
32+
VERSION="0.2.1.dev${COMMIT_COUNT}"
33+
# Create and push tag
34+
git tag -a "v${VERSION}" -m "Test release ${VERSION}"
35+
echo "Created tag v${VERSION}"
36+
1837
- name: Install Hatch
1938
run: pip install hatch
39+
2040
- name: Build
2141
run: hatch build
42+
2243
- name: Publish distribution 📦 to Test PyPI
2344
uses: pypa/gh-action-pypi-publish@release/v1
2445
with:
2546
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
26-
repository-url: https://test.pypi.org/legacy/
47+
repository-url: https://test.pypi.org/legacy/

.github/workflows/pytest.yml

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,44 @@ on:
33
push:
44
pull_request:
55

6-
# adapted from: https://github.com/tiangolo/poetry-version-plugin
76
jobs:
87
test:
98
strategy:
10-
fail-fast: true
9+
fail-fast: false
1110
matrix:
12-
os: [ "ubuntu-latest", "macos-latest" , "windows-latest"]
13-
python-version: [ "3.9" ]
14-
defaults:
15-
run:
16-
shell: bash
11+
os: [ "ubuntu-latest", "macos-latest", "windows-latest"]
12+
python-version: [ "3.10", "3.11" ]
13+
1714
runs-on: ${{ matrix.os }}
1815
steps:
1916
- name: Check out repository
20-
uses: actions/checkout@v3
21-
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
2220
- name: Set up python ${{ matrix.python-version }}
2321
id: setup-python
24-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@v5
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v5
2525
with:
26-
python-version: ${{ matrix.python-version }}
27-
cache: pip
28-
cache-dependency-path: requirements/requirements-${{ matrix.os }}-${{ matrix.python-version }}.txt
29-
30-
- name: Install pinned requirements
26+
# Install a specific version of uv.
27+
version: "0.5.4"
28+
enable-cache: true
29+
cache-dependency-glob: requirements/requirements-${{ matrix.os }}-${{ matrix.python-version }}.txt
30+
- name: Install dependencies
31+
shell: bash
3132
run: |
32-
python -m pip install --upgrade pip
33-
pip install -r requirements/requirements-${{ matrix.os }}-${{ matrix.python-version }}.txt --prefer-binary
34-
35-
- name: Install test requirements
36-
run: pip install .[test]
37-
33+
uv venv -p ${{ matrix.python-version }}
34+
if [ "${{ matrix.os }}" == "windows-latest" ]; then
35+
source .venv/Scripts/activate
36+
else
37+
source .venv/bin/activate
38+
fi
39+
echo PATH=$PATH >> $GITHUB_ENV
40+
uv pip install -r requirements/requirements-${{ matrix.os }}-${{ matrix.python-version }}.txt
41+
uv pip install -e .[test]
42+
# - name: Install test requirements
43+
# run:
3844
- name: Run tests
3945
run: |
40-
pytest tests/
46+
uv run pytest tests/

0 commit comments

Comments
 (0)