Skip to content
Merged
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
7 changes: 3 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@

version: 2
updates:
# Configuration for pip
# - package-ecosystem: "pip" # See documentation for possible values
# directory: "/etc/requirements_dependabot" # Location of package manifests
# - package-ecosystem: "uv" # See documentation for possible values
# directory: "/" # Location of package manifests
# schedule:
# interval: "daily"
# for reference:
Expand All @@ -23,4 +22,4 @@ updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
interval: "monthly"
26 changes: 12 additions & 14 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,17 @@ jobs:
python-version: ["3.9", "3.13"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- uses: actions/checkout@v5
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'requirements_tests.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_tests.txt
pip install -e .
- name: Test with pytest
# fail it if doesn't pass test suite
run: |
pytest
- name: Enable caching
uses: astral-sh/setup-uv@v6
with:
enable-cache: true

- name: Install the project
run: uv sync --locked --group test --no-dev
- name: Run tests
run: uv run pytest
86 changes: 37 additions & 49 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,46 @@ on:
types: [released]

permissions:
id-token: write
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: pypi
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build

- name: Build package
run: python -m build

- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/

- name: Install from testpypi and import
run: |
sleep 5
while [ "${{ github.ref_name }}" != $(pip index versions -i https://test.pypi.org/simple --pre valimp | cut -d'(' -f2 | cut -d')' -f1 | sed 1q) ];\
do echo "waiting for package to appear in test index, sleeping 5s"; sleep 5s; echo "woken up"; done
pip install --index-url https://test.pypi.org/simple valimp==${{ github.ref_name }} --no-deps
pip install -r requirements.txt
python -c 'import valimp;print(valimp.__version__)'

- name: Clean pip
run: |
pip uninstall -y valimp
pip cache purge

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Install and import
run: |
sleep 5
while [ "${{ github.ref_name }}" != $(pip index versions -i https://pypi.org/simple --pre valimp | cut -d'(' -f2 | cut -d')' -f1 | sed 1q) ];\
do echo "waiting for package to appear in index, sleeping 5s"; sleep 5s; echo "woken up"; done
pip install --index-url https://pypi.org/simple valimp==${{ github.ref_name }}
python -c 'import valimp;print(valimp.__version__)'
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install Python
run: uv python install
- name: Build
run: uv build

- name: Publish to Test PyPI
run: uv publish --index testpypi
- name: Check test install and import
run: |
sleep 5 # Wait for Test Pypi to publish
uv run \
--with valimp \
--refresh-package valimp \
--index https://test.pypi.org/simple \
--no-project \
--isolated \
-- \
python -c 'import valimp; print(f"{valimp.__version__=}")'

- name: Publish to PyPI
run: uv publish
- name: Check install and import
run: |
sleep 5 # Wait for Pypi to publish
uv run \
--with valimp \
--refresh-package valimp \
--no-project \
--isolated \
-- \
python -c 'import valimp;print(f"{valimp.__version__=}")'
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,9 @@ documentation = "https://github.com/maread99/valimp"

[tool.setuptools_scm]
write_to = "src/valimp/_version.py"

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true
8 changes: 2 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile pyproject.toml
#
# This file was autogenerated by uv via the following command:
# uv export --format requirements-txt --no-emit-project --no-hashes --no-dev -o requirements.txt
120 changes: 0 additions & 120 deletions requirements_dev.txt

This file was deleted.

54 changes: 0 additions & 54 deletions requirements_tests.txt

This file was deleted.

9 changes: 0 additions & 9 deletions setup.py

This file was deleted.

6 changes: 3 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.