-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ⭐ Introducing
UV
as package manager (#1785)
* feat: ✨ Introduce UV instead of poetry * feat: 🔧 bump version to 1.2.0 and update tests * chore: ✨ update project configuration and improve build process * feat: ✨ migrate CI workflow from Poetry to UV for dependency management * fix: ✅ clean up file handling and remove unnecessary type ignore in tests * fix: ✅ update pre-commit configuration to exclude uv.lock instead of poetry.lock * fix: 🚨 standardize YAML formatting in GitHub workflows and labeler configuration * fix: ✅ remove quotes from cache-dependency-glob in CI workflow * ci: 👷 update trunk.yaml to latest plugin versions and CLI version * fix: ✏️ correct command syntax in CI workflow for running tests * fix: 📝 add uv.lock to labeler configuration for dependency tracking * ci: 👷 enhance CI workflow for uv installation and project setup * fix: 🐛 add stacklevel argument to DeprecationWarning for clearer warning context * fix: ✏️ update CI workflow to install any wheel file and run spectrafit with verbose output * fix: 🚨 adjust stacklevel argument in DeprecationWarning for clearer warning context * ci: 👷 add uv build step to CI workflow for project installation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: 🐛 add type ignore comment for AutoPeakDetection instantiation in tests * fix: 🐛 remove type ignore comment for AutoPeakDetection instantiation in tests * fix: 🐛 add type ignore comment for AutoPeakDetection instantiation in tests * ci: 👷 update CI workflow to rename project installation step and add wheel installation * feat: 🎨 update devcontainer configuration to use latest features and install uv for environment setup * feat: 🎨 update devcontainer configuration to use latest versions of GitHub CLI and remove unused features * fix: 🐛 update devcontainer configuration to include Docker-in-Docker and Git features, and adjust GitHub CLI installation * docs: 📝 update installation instructions to replace Poetry with UV as the package manager for SpectraFit * feat: 🎨 update GitHub Actions workflow to replace Poetry with uv for dependency management * ci: ✅ update GitHub Actions workflow to replace Poetry with uv for dependency management * docs: 📝 clean up reference links in documentation files * chore: 📝 clean up formatting in CONTRIBUTING.md, codecov.yml, and renovate.json * fix: 🐛 add stacklevel parameter to warning messages for better traceability --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4011a88
commit 3596f33
Showing
34 changed files
with
7,585 additions
and
7,132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
python -m pip install --upgrade pip | ||
python -m pip install poetry | ||
poetry config virtualenvs.in-project true | ||
python -m poetry install --with dev,docs --all-extras | ||
python -m pip install uv | ||
uv venv --python 3.10 | ||
uv sync --all-extras --all-groups |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,83 @@ | ||
root: | ||
- changed-files: | ||
- any-glob-to-any-file: '*' | ||
- changed-files: | ||
- any-glob-to-any-file: "*" | ||
codeowners: | ||
- changed-files: | ||
- any-glob-to-any-file: .github/CODEOWNERS | ||
- changed-files: | ||
- any-glob-to-any-file: .github/CODEOWNERS | ||
codespaces: | ||
- changed-files: | ||
- any-glob-to-any-file: .devcontainer/** | ||
- changed-files: | ||
- any-glob-to-any-file: .devcontainer/** | ||
dependencies: | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- poetry.lock | ||
- github/dependabot.yml | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- uv.lock | ||
- poetry.lock | ||
- github/dependabot.yml | ||
documentation: | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- docs/** | ||
- Examples/** | ||
- mkdocs.yml | ||
- README.md | ||
- INSTALLATION.md | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- docs/** | ||
- Examples/** | ||
- mkdocs.yml | ||
- README.md | ||
- INSTALLATION.md | ||
forms: | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- .github/ISSUE_TEMPLATE/** | ||
- .github/pull_request_template.md | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- .github/ISSUE_TEMPLATE/** | ||
- .github/pull_request_template.md | ||
github-actions: | ||
- changed-files: | ||
- any-glob-to-any-file: .github/workflows/** | ||
- changed-files: | ||
- any-glob-to-any-file: .github/workflows/** | ||
pre-commit: | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- .pre-commit-config.yaml | ||
- .pre-commit-hooks.yaml | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- .pre-commit-config.yaml | ||
- .pre-commit-hooks.yaml | ||
python: | ||
- changed-files: | ||
- any-glob-to-any-file: "spectrafit/**/*.py" | ||
- changed-files: | ||
- any-glob-to-any-file: "spectrafit/**/*.py" | ||
testing: | ||
- changed-files: | ||
- any-glob-to-any-file: "spectrafit/**/test_*.py" | ||
- changed-files: | ||
- any-glob-to-any-file: "spectrafit/**/test_*.py" | ||
docker: | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- Dockerfile | ||
- .dockerignore | ||
- .devcontainer/Dockerfile | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- Dockerfile | ||
- .dockerignore | ||
- .devcontainer/Dockerfile | ||
release: | ||
- changed-files: | ||
- any-glob-to-any-file: spectrafit/__init__.py | ||
- changed-files: | ||
- any-glob-to-any-file: spectrafit/__init__.py | ||
vendor: | ||
- changed-files: | ||
- any-glob-to-any-file: vendor/** | ||
- changed-files: | ||
- any-glob-to-any-file: vendor/** | ||
maintenance: | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- .gitignore | ||
- .github/dependabot.yml | ||
- .github/release-drafter.yml | ||
- .github/labeler.yml | ||
- .github/workflows/label.yml | ||
- .sonarcloud.properties | ||
- .pre-commit-config.yaml | ||
- .prettierignore | ||
- .pylintrc | ||
- .sonarcloud.properties | ||
- .sourcery.yaml | ||
- "pyproject.toml" | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- .gitignore | ||
- .github/dependabot.yml | ||
- .github/release-drafter.yml | ||
- .github/labeler.yml | ||
- .github/workflows/label.yml | ||
- .sonarcloud.properties | ||
- .pre-commit-config.yaml | ||
- .prettierignore | ||
- .pylintrc | ||
- .sonarcloud.properties | ||
- .sourcery.yaml | ||
- "pyproject.toml" | ||
license: | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- LICENSE | ||
- THIRD_PARTY_LICENSES | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- LICENSE | ||
- THIRD_PARTY_LICENSES | ||
security: | ||
- changed-files: | ||
- any-glob-to-any-file: SECURITY.md | ||
- changed-files: | ||
- any-glob-to-any-file: SECURITY.md | ||
code-of-conduct: | ||
- changed-files: | ||
- any-glob-to-any-file: CODE_OF_CONDUCT.md | ||
- changed-files: | ||
- any-glob-to-any-file: CODE_OF_CONDUCT.md | ||
changelog: | ||
- changed-files: | ||
- any-glob-to-any-file: CHANGELOG.md | ||
- changed-files: | ||
- any-glob-to-any-file: CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ on: | |
repository_dispatch: | ||
types: [create-pull-request] | ||
|
||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ on: | |
repository_dispatch: | ||
types: [create-pull-request] | ||
|
||
|
||
jobs: | ||
docker: | ||
# Only if Dockerfile is changed | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,26 +48,15 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Set up python ${{ matrix.python-version }} | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: uv.lock | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Poetry and dependencies with dev-dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
poetry config virtualenvs.path .venv | ||
poetry install --no-interaction --with dev -E all | ||
- name: Install the project | ||
run: uv sync --all-extras --dev | ||
- name: Test SpectraFit | ||
run: poetry run pytest | ||
run: uv run --group dev --all-extras pytest spectrafit/ | ||
- name: Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
|
@@ -83,17 +72,36 @@ jobs: | |
needs: build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: uv.lock | ||
python-version: "3.10" | ||
- name: Install Poetry and dependencies without dev-dependencies | ||
- name: Install the project | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
poetry config virtualenvs.path .venv | ||
poetry install --no-interaction --only main | ||
uv sync --all-extras | ||
uv run pip install -e . | ||
install-build: | ||
name: Install SpectraFit from wheel | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: uv.lock | ||
python-version: "3.10" | ||
- name: Setup the project | ||
run: | | ||
uv sync --all-extras | ||
uv build | ||
- name: Install the wheel | ||
run: | | ||
uv pip install dist/*.whl | ||
uv run spectrafit -v | ||
documentation: | ||
name: Build Documentation | ||
runs-on: ubuntu-latest | ||
|
@@ -102,27 +110,24 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v5 | ||
- name: Install uv and dependencies with doc-dependencies | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: uv.lock | ||
python-version: "3.10" | ||
- name: Install Poetry and dependencies with doc-dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
poetry config virtualenvs.path .venv | ||
poetry install --no-interaction --with docs --all-extras | ||
- name: Install the project | ||
run: uv sync --all-extras --group docs | ||
- name: Set git config | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
- name: Build documentation | ||
if: ${{ !contains(github.ref, 'refs/heads/main')}} | ||
run: poetry run mkdocs build --clean | ||
run: uv run --group docs --all-extras mkdocs build --clean | ||
- name: Deploy documentation develops | ||
if: contains(github.ref, 'refs/heads/main') | ||
run: poetry run mike deploy --push --update-aliases develop | ||
run: uv run --group docs --all-extras mike deploy --push --update-aliases develop | ||
devcontainer: | ||
name: Devcontainer | ||
needs: build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,16 +78,15 @@ jobs: | |
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Install Poetry and dependencies with doc-dependencies | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: uv.lock | ||
python-version: "3.10" | ||
- name: Install the project | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
poetry config virtualenvs.path .venv | ||
poetry install --no-interaction --with docs --all-extras | ||
- name: Install library | ||
run: poetry install --no-interaction --with docs --all-extras | ||
uv sync --all-extras --all-groups | ||
- name: Set git config | ||
run: | | ||
git config --local user.email "[email protected]" | ||
|
@@ -108,9 +107,9 @@ jobs: | |
previous_version=$(echo $previous_tag | cut -d '.' -f 1,2) | ||
current_version=$(echo $current_tag | cut -d '.' -f 1,2) | ||
if [[ "$previous_version" == "$current_version" ]]; then | ||
poetry run mike delete ${{ steps.previous_release.outputs.previous_tag }} --push | ||
uv run mike delete ${{ steps.previous_release.outputs.previous_tag }} --push | ||
fi | ||
- name: Deploy documentation develops | ||
run: | | ||
poetry run mike deploy --push --update-aliases ${{ github.event.release.tag_name }} latest --message "Release ${{ github.event.release.tag_name }}" | ||
poetry run mike set-default --push latest | ||
uv run mike deploy --push --update-aliases ${{ github.event.release.tag_name }} latest --message "Release ${{ github.event.release.tag_name }}" | ||
uv run mike set-default --push latest |
Oops, something went wrong.