Skip to content

Commit

Permalink
Drop uv in as replacement for pip
Browse files Browse the repository at this point in the history
  • Loading branch information
alukach committed Mar 6, 2025
1 parent 3530e02 commit 42ace62
Show file tree
Hide file tree
Showing 8 changed files with 701 additions and 48 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,22 @@ jobs:
run: |
mkdir -p ~/.config/earthengine
echo '${{ secrets.EE_CREDENTIALS_JSON }}' > ~/.config/earthengine/credentials
- uses: astral-sh/setup-uv@v5
with:
version: "latest"

- name: Install dependencies
run: |
pip install -r requirements-dev.txt
uv sync --dev --locked
- name: Run pre-commit checks
run: |
pre-commit run --all-files
- name: Run tests with coverage
run: |
python -m pytest --cov=. --cov-report=html --cov-report=term-missing test/
uv run pytest --cov=. --cov-report=html --cov-report=term-missing test/
- name: Upload coverage report
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qgis-plugin-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install paver
- name: Package QGIS Plugin
run: |
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9.5
25 changes: 1 addition & 24 deletions pavement.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,8 @@ def setup():
if clean:
ext_libs.rmtree()
ext_libs.makedirs()
reqs = read_requirements()
os.environ["PYTHONPATH"] = ext_libs.abspath()
for req in reqs:
if platform.system() == "Windows":
sh(
'pip install -U -t "{ext_libs}" "{dep}"'.format(
ext_libs=ext_libs.abspath(), dep=req
)
)
else:
sh(
'pip3 install -U -t "{ext_libs}" "{dep}"'.format(
ext_libs=ext_libs.abspath(), dep=req
)
)
sh(f"uv pip install -U --target {ext_libs.abspath()} -r pyproject.toml")
clean_extlibs()


Expand Down Expand Up @@ -107,16 +94,6 @@ def install(options):
src.symlink(dst)


def read_requirements():
"""return a list of packages in requirements file"""
with open("requirements.txt") as f:
return [
line.strip("\n")
for line in f
if line.strip("\n") and not line.startswith("#")
]


@task
@cmdopts([("tests", "t", "Package tests with plugin")])
def package(options):
Expand Down
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[project]
name = "qgis-earthengine-plugin"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = "==3.9.5"
dependencies = [
"earthengine-api>=0.1.335",
"httplib2>=0.22.0",
"ratelim>=0.1.6",
"requests>2.4",
"six>=1.13",
]

[dependency-groups]
dev = [
"future>=1.0.0",
"paver>=1.3.4",
"pre-commit>=4.1.0",
"pyqt5>=5.15.11",
"pytest-cov>=6.0.0",
"pytest-qgis==2.1.0",
"pytest==7.4.3",
]
11 changes: 0 additions & 11 deletions requirements-dev.txt

This file was deleted.

10 changes: 0 additions & 10 deletions requirements.txt

This file was deleted.

668 changes: 668 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit 42ace62

Please sign in to comment.