Skip to content

Commit

Permalink
Merge pull request #26 from blueraft/use-uv
Browse files Browse the repository at this point in the history
Use uv for dev deps
  • Loading branch information
ladinesa authored Sep 11, 2024
2 parents 5c2164c + 9574a34 commit d257724
Show file tree
Hide file tree
Showing 3 changed files with 2,513 additions and 49 deletions.
64 changes: 24 additions & 40 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,31 @@ on: [push]
jobs:
install-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install --upgrade pip
# we need the latest nomad version for testing
# pip install nomad-lab[infrastructure]@git+https://github.com/nomad-coe/nomad.git@develop
pip install '.[dev,tests]' --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple
pip install coverage coveralls
- name: mypy
run: |
python -m mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional simulationworkflowschema tests
- name: Test with pytest
run: |
python -m coverage run -m pytest -sv tests
- name: Submit to coveralls
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
build-and-install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Build the package
run: |
pip install --upgrade pip
pip install build
python -m build --sdist
- name: Install the package
run: |
pip install dist/*.tar.gz --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}

- name: Install uv
uses: astral-sh/setup-uv@v2

- name: Install dependencies
run: |
uv sync
- name: mypy
run: |
uv run mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional simulationworkflowschema tests
- name: Test with pytest
run: |
uv run pytest -sv tests
ruff:
runs-on: ubuntu-latest
steps:
Expand Down
21 changes: 12 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,24 @@ dependencies = [
"scipy>=1.7.1",
"networkx>=2.6.3",
]
requires-python = ">=3.9"

[project.urls]
homepage = "https://github.com/nomad-coe/nomad-schema-simulation-workflow-plugin"

[project.optional-dependencies]
dev = [
"mypy==1.0.1",
"pytest==3.10.0",
"pytest-timeout==1.4.2",
"pytest-cov==2.7.1",
"ruff==0.1.4",
]
tests = [
[tool.uv]
dev-dependencies = [
"nomad-normalizer-plugin-bandstructure@git+https://github.com/nomad-coe/nomad-normalizer-plugin-bandstructure.git@develop",
"nomad-normalizer-plugin-system@git+https://github.com/nomad-coe/nomad-normalizer-plugin-system.git@develop",
"mypy==1.0.1",
"pytest",
"pytest-timeout",
"pytest-cov",
"ruff",

]
extra-index-url = [
"https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple",
]

[tool.ruff]
Expand Down
Loading

0 comments on commit d257724

Please sign in to comment.