Skip to content

Commit ccceaa7

Browse files
committed
Switch build system to uv
No more parallel dependency lists! \^_^/
1 parent b71c8b3 commit ccceaa7

File tree

11 files changed

+30
-175
lines changed

11 files changed

+30
-175
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- main
1212

1313
jobs:
14-
build-cross-platform:
14+
build:
1515
name: test ${{matrix.os}} - ${{matrix.python-version}} - ${{matrix.java-version}}
1616
runs-on: ${{ matrix.os }}
1717
strategy:
@@ -33,79 +33,27 @@ jobs:
3333
java-version: ''
3434

3535
steps:
36-
- uses: actions/checkout@v2
36+
- uses: actions/checkout@v4
3737

38-
- uses: actions/setup-python@v3
38+
- uses: actions/setup-python@v5
3939
with:
4040
python-version: ${{matrix.python-version}}
4141

42-
- uses: actions/setup-java@v3
42+
- uses: actions/setup-java@v4
4343
if: matrix.java-version != ''
4444
with:
4545
java-version: ${{matrix.java-version}}
4646
distribution: 'zulu'
4747
cache: 'maven'
4848

49-
- name: Install ScyJava
49+
- name: Run tests
5050
run: |
51-
python -m pip install --upgrade pip
52-
python -m pip install -e '.[dev]'
51+
bin/test.sh
5352
54-
- name: Test ScyJava
53+
- name: Lint code
5554
run: |
56-
bin/test.sh --color=yes
55+
bin/lint.sh
5756
58-
ensure-clean-code:
59-
runs-on: ubuntu-latest
60-
steps:
61-
- uses: actions/checkout@v2
62-
- uses: actions/setup-python@v3
63-
64-
- name: Lint code
65-
run: |
66-
python -m pip install ruff
67-
ruff check
68-
ruff format --check
69-
70-
- name: Validate pyproject.toml
71-
run: |
72-
python -m pip install validate-pyproject[all]
73-
python -m validate_pyproject pyproject.toml
74-
75-
conda-dev-test:
76-
name: Conda Setup & Code Coverage
77-
runs-on: ubuntu-latest
78-
defaults:
79-
# Steps that rely on the activated environment must be run with this shell setup.
80-
# See https://github.com/marketplace/actions/setup-miniconda#important
81-
run:
82-
shell: bash -l {0}
83-
steps:
84-
- uses: actions/checkout@v2
85-
- name: Cache conda
86-
uses: actions/cache@v4
87-
env:
88-
# Increase this value to reset cache if dev-environment.yml has not changed
89-
CACHE_NUMBER: 0
90-
with:
91-
path: ~/conda_pkgs_dir
92-
key:
93-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('dev-environment.yml') }}
94-
- uses: conda-incubator/setup-miniconda@v3
95-
with:
96-
# Create env with dev packages
97-
auto-update-conda: true
98-
python-version: 3.9
99-
miniforge-version: latest
100-
environment-file: dev-environment.yml
101-
# Activate scyjava-dev environment
102-
activate-environment: scyjava-dev
103-
auto-activate-base: false
104-
# Use mamba for faster setup
105-
use-mamba: true
106-
- name: Test scyjava
107-
run: |
108-
bin/test.sh --cov-report=xml --cov=.
109-
# We could do this in its own action, but we'd have to setup the environment again.
110-
- name: Upload Coverage to Codecov
111-
uses: codecov/codecov-action@v2
57+
- name: Upload coverage
58+
if: matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.13' && matrix.java-version == '11'
59+
uses: codecov/codecov-action@v4

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ coverage.xml
2323
# IDEA
2424
.idea/
2525
*.iml
26+
27+
# uv
28+
/.venv/
29+
/uv.lock

Makefile

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,22 @@
11
help:
22
@echo "Available targets:\n\
33
clean - remove build files and directories\n\
4-
setup - create mamba developer environment\n\
54
lint - run code formatters and linters\n\
65
test - run automated test suite\n\
76
dist - generate release archives\n\
8-
\n\
9-
Remember to 'mamba activate scyjava-dev' first!"
7+
"
108

119
clean:
1210
bin/clean.sh
1311

14-
setup:
15-
bin/setup.sh
16-
1712
check:
1813
@bin/check.sh
1914

2015
lint: check
2116
bin/lint.sh
2217

23-
fmt: check
24-
bin/fmt.sh
25-
2618
test: check
2719
bin/test.sh
2820

2921
dist: check clean
30-
python -m build
31-
32-
.PHONY: test
22+
bin/dist.sh

bin/check.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#!/bin/sh
22

3-
case "$CONDA_PREFIX" in
4-
*/scyjava-dev)
5-
;;
6-
*)
7-
echo "Please run 'make setup' and then 'mamba activate scyjava-dev' first."
8-
exit 1
9-
;;
10-
esac
3+
if ! command -v uv >/dev/null 2>&1; then
4+
echo "Please install uv (https://docs.astral.sh/uv/getting-started/installation/)."
5+
exit 1
6+
fi

bin/setup.sh renamed to bin/dist.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
dir=$(dirname "$0")
44
cd "$dir/.."
55

6-
mamba env create -f dev-environment.yml
6+
uv run python -m build

bin/fmt.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

bin/lint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ dir=$(dirname "$0")
44
cd "$dir/.."
55

66
exitCode=0
7-
ruff check
7+
uv run validate-pyproject pyproject.toml
88
code=$?; test $code -eq 0 || exitCode=$code
9-
ruff format --check
9+
uv run ruff check --fix
1010
code=$?; test $code -eq 0 || exitCode=$code
11-
validate-pyproject pyproject.toml
11+
uv run ruff format
1212
code=$?; test $code -eq 0 || exitCode=$code
1313
exit $exitCode

bin/test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
# Executes the pytest framework in both JPype and Jep modes.
3+
# Runs the unit tests.
44
#
55
# Usage examples:
66
# bin/test.sh
@@ -19,9 +19,9 @@ echo "----------------------"
1919

2020
if [ $# -gt 0 ]
2121
then
22-
python -m pytest -p no:faulthandler $@
22+
uv run python -m pytest -v -p no:faulthandler $@
2323
else
24-
python -m pytest -p no:faulthandler tests/
24+
uv run python -m pytest -v -p no:faulthandler tests/
2525
fi
2626
jpypeCode=$?
2727

@@ -32,7 +32,7 @@ echo "-----------------------------"
3232
itCode=0
3333
for t in tests/it/*.py
3434
do
35-
python "$t"
35+
uv run python "$t"
3636
code=$?
3737
printf -- "--> %s " "$t"
3838
if [ "$code" -eq 0 ]

dev-environment.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

environment.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)