Skip to content

Commit a9cee00

Browse files
updates (#131)
- switch from poetry to uv - switch from isort/black to ruff - remove code using yaml from tests - pin ci runner versions - test on python 3.12, no longer 3.8 which is EOL - update pyright, devcontainer cli
1 parent a3730bc commit a9cee00

27 files changed

+1557
-1605
lines changed

.devcontainer/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ ARG NODE_VERSION="lts/*"
66
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
77
USER vscode
88
RUN pip3 --disable-pip-version-check --no-cache-dir install -U \
9-
'poetry==1.8.3' \
10-
'pip==22.1.2'
11-
RUN npm install -g @devcontainers/cli@v0.30.0
9+
'pip==22.1.2' \
10+
'uv==0.5.11'
11+
RUN npm install -g @devcontainers/cli@v0.72.0

.devcontainer/devcontainer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,5 @@
2323
"features": {
2424
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
2525
},
26-
"postCreateCommand": "poetry install",
2726
"remoteUser": "vscode"
2827
}

.devcontainer/vm/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ ARG NODE_VERSION="lts/*"
66
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
77
USER vscode
88
RUN pip3 --disable-pip-version-check --no-cache-dir install -U \
9-
'poetry==1.8.3' \
109
'pip==22.1.2'
11-
RUN npm install -g @devcontainers/cli@v0.30.0
10+
RUN npm install -g @devcontainers/cli@v0.72.0

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,12 @@ Steps to reproduce the behavior:
2525
**Expected behavior**
2626
A clear and concise description of what you expected to happen.
2727

28-
**Screenshots**
29-
If applicable, add screenshots to help explain your problem.
30-
31-
**Desktop (please complete the following information):**
32-
- OS: [e.g. iOS]
33-
- Browser [e.g. chrome, safari]
34-
- Version [e.g. 22]
35-
36-
**Smartphone (please complete the following information):**
37-
- Device: [e.g. iPhone6]
38-
- OS: [e.g. iOS8.1]
39-
- Browser [e.g. stock browser, safari]
40-
- Version [e.g. 22]
28+
**Relevant versions**
29+
30+
Please share which versions you have with this:
31+
```sh
32+
uv pip show nbmake nbclient ipykernel pytest | grep -E "^(Name|Version):"
33+
```
4134

4235
**Additional context**
4336
Add any other context about the problem here.

.github/workflows/publish-to-pypi.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ on:
44
types: [published]
55
jobs:
66
build-n-publish:
7-
runs-on: ubuntu-22.04
7+
runs-on: ubuntu-24.04
88
steps:
99
- uses: actions/checkout@master
1010
- uses: actions/setup-python@v2
11-
- run: pip install poetry
12-
- run: poetry version ${GITHUB_REF:10}
13-
- run: poetry build
11+
- run: pip install uv
12+
- run: uv build
1413
- run: pip install twine==4.0.1
1514
- run: twine upload dist/* -u __token__ -p ${{ secrets.PYPI_API_TOKEN }}
1615
- uses: EndBug/[email protected]
@@ -19,4 +18,4 @@ jobs:
1918
author_email: 41898282+github-actions[bot]@users.noreply.github.com
2019
add: pyproject.toml
2120
branch: main
22-
message: Published new version
21+
message: Published new version

.github/workflows/pytest.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,31 @@ jobs:
99
runs-on: ubuntu-22.04
1010
steps:
1111
- uses: actions/checkout@v2
12-
- run: npm install -g @devcontainers/cli@v0.30.0
12+
- run: npm install -g @devcontainers/cli@v0.72.0
1313
- run: devcontainer up --workspace-folder=.
14-
- run: devcontainer exec --workspace-folder=. poetry run pre-commit run --verbose --all-files
15-
- run: devcontainer exec --workspace-folder=. poetry run pytest --cov-report=xml --cov=src
16-
- uses: codecov/codecov-action@v1
17-
with:
18-
file: coverage.xml
14+
- run: devcontainer exec --workspace-folder=. uv venv
15+
- run: devcontainer exec --workspace-folder=. uv pip install pre-commit pytest
16+
- run: devcontainer exec --workspace-folder=. uv run pre-commit run --verbose --all-files
17+
- run: devcontainer exec --workspace-folder=. uv run pytest
1918
pytest:
2019
strategy:
2120
fail-fast: false
2221
matrix:
2322
os:
24-
- ubuntu-latest
25-
- macos-latest
23+
- ubuntu-24.04
24+
- macos-14
2625
python-version:
27-
- "3.8"
2826
- "3.9"
2927
- "3.10"
3028
- "3.11"
29+
- "3.12"
3130
runs-on: ${{ matrix.os }}
3231
steps:
3332
- uses: actions/checkout@v2
3433
- uses: actions/setup-python@v2
3534
with:
3635
python-version: ${{ matrix.python-version }}
37-
- run: pip install poetry
38-
- run: poetry install
39-
- run: poetry run pytest --cov-report=xml --cov=src
40-
- uses: codecov/codecov-action@v1
41-
with:
42-
file: coverage.xml
36+
- run: pipx install uv
37+
- run: uv venv
38+
- run: uv pip install -e .
39+
- run: uv run pytest

.github/workflows/test-publish-to-pypi.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@ on:
55
- main
66
jobs:
77
build-n-publish:
8-
runs-on: ubuntu-22.04
8+
runs-on: ubuntu-24.04
99
steps:
1010
- uses: actions/checkout@master
1111
- uses: actions/setup-python@v2
12-
- run: pip install poetry
13-
- name: Set poetry version to dev
14-
run: |
15-
build_version="$(poetry version -s).dev$(date +%s)"
16-
poetry version $build_version
17-
- run: poetry build
12+
- run: pip install uv
13+
- run: uv build
1814
- run: pip install 'pytest==7.1'
1915
- run: pip install dist/*gz --force-reinstall
2016
- run: pytest --nbmake tests/resources/mock.ipynb

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,4 @@ typeshed
133133

134134
trash
135135
**/_build
136+
.aider*

.pre-commit-config.yaml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,19 @@ repos:
1313
rev: 0.5.0
1414
hooks:
1515
- id: nbstripout
16-
- repo: https://github.com/ambv/black
17-
rev: 22.3.0
16+
- repo: https://github.com/astral-sh/ruff-pre-commit
17+
rev: v0.1.9
1818
hooks:
19-
- id: black
20-
files: '(src|tests).*py'
21-
- repo: https://github.com/PyCQA/isort
22-
rev: 5.12.0
23-
hooks:
24-
- id: isort
25-
args: ["-m", "3", "--tc"]
19+
- id: ruff
20+
args: [--fix, --exit-non-zero-on-fix]
21+
- id: ruff-format
22+
args: [--line-length=88]
2623
- repo: local
2724
hooks:
2825
- id: pyright
2926
name: pyright
30-
entry: poetry run pyright
27+
entry: uv run pyright
3128
language: node
3229
pass_filenames: false
3330
types: [python]
34-
additional_dependencies: ["[email protected]"]
35-
# - repo: local
36-
# hooks:
37-
# - id: smoketest
38-
# name: smoketest
39-
# entry: poetry run pytest -k test_when_nb_present_then_collected
40-
# language: system
41-
# pass_filenames: false
31+
additional_dependencies: ["[email protected]"]

CONTRIBUTING.MD

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ nbmake uses devcontainers to pre-configure a dev environment. We recommend you o
55

66
For non-vscode users, here are some install steps:
77

8-
### Install local package
9-
```
10-
poetry install
11-
```
12-
13-
### Activate shell
14-
```
15-
poetry shell
16-
```
17-
188
### Run static checks
199
```
2010
pre-commit run --all-files

0 commit comments

Comments
 (0)