Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.5.2: move to uv #43

Merged
merged 21 commits into from
Dec 25, 2024
Merged
38 changes: 38 additions & 0 deletions .github/workflows/pyfuppes-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: pyfuppes-tests

on:
push:
tags:
- "v*"
pull_request:
branches: [master]

jobs:
build:
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest] # , windows-latest]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4

- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "uv.lock" # invalidate cache if lockfile changes

- name: Install the project
run: uv sync --all-extras --dev

- name: Run black formatting
run: uv run black . --color --diff --check

- name: Run ruff ckecks
run: uv run ruff check --target-version=py312

- name: Run tests
run: uv run -m pytest
52 changes: 0 additions & 52 deletions .github/workflows/pyfuppes-tests.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.4.2"
rev: "v0.8.4"
hooks:
- id: ruff
- repo: local
hooks:
- id: pytest
name: pytest
stages: [commit]
stages: [pre-commit]
types: [python]
entry: pytest
language: system
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ Types of changes

## Unreleased

## v0.5.2 (xxxx-xx-xx)

### Changed

- move from pyenv / poetry to uv
- avgbinmap.bin_y_of_t, keyword 'return_type' renamed to 'aggregation'

## v0.5.1 (2024-09-06)
Expand Down
3,331 changes: 0 additions & 3,331 deletions poetry.lock

This file was deleted.

71 changes: 38 additions & 33 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,51 +1,56 @@
[tool.poetry]
[project]
authors = [{ name = "Florian Obersteiner", email = "f.obersteiner@posteo.de" }]
license = { text = "LGPL3" }
name = "pyfuppes"
version = "0.5.1"
description = "A collection of tools in Python"
authors = ["Florian Obersteiner <f.obersteiner@posteo.de>"]
license = "LGPL3"
readme = "README.md"
requires-python = "<3.13,>=3.10"
dependencies = [
"geopy>=2.0",
"matplotlib>=3.0",
"netcdf4>=1.6",
"numba>=0.59.0",
"numpy>=1.18",
"pandas>=2.0",
"polars>=1.0",
"pysolar>=0.10",
"scipy>=1.1",
"scikit-learn>=1.4",
"tomli>=2.0.1",
"xarray>=2022,>=2023,>=2024",
]

[tool.poetry.dependencies]
python = ">= 3.10, < 3.13"
geopy = ">= 2.0"
matplotlib = ">= 3.0"
netcdf4 = ">= 1.6"
numba = ">= 0.59.0" # needed for Python 3.12
numpy = ">= 1.18"
pandas = ">= 2.0"
polars = ">= 1.0"
pysolar = ">= 0.10"
scipy = ">= 1.1"
scikit-learn = ">= 1.4" # lof filter
tomli = ">= 2.0.1"
xarray = ">= 2022, >= 2023, >= 2024"
[dependency-groups]
dev = [
"pre-commit>=3.3.3",
"pytest>=7.0",
"black>=24.3",
"flake8>=6.0",
"ruff>=0.0.254",
"jupyter-core>=4.0",
"sphinx-autoapi>=2.0",
"sphinx-rtd-theme>=1.0",
"myst-nb>=0.17",
]

[tool.poetry.dev-dependencies]
pytest = ">= 7.0"
black = ">= 24.3"
flake8 = ">= 6.0"
ruff = ">= 0.0.254"
jupyter_core = ">= 4.0"
sphinx-autoapi = ">= 2.0"
sphinx-rtd-theme = ">= 1.0"
myst-nb = ">= 0.17"

[tool.poetry.group.dev.dependencies]
pre-commit = ">= 3.3.3"

[tool.black]
line-length = 100
target-version = ["py39", "py310", "py311", "py312"]

[tool.ruff] # https://github.com/charliermarsh/ruff
lint.ignore = ["E501"] # use defaults otherwise
[tool.ruff]
lint.ignore = ["E501"]
lint.extend-select = ["I", "C4", "SIM"]
# "C4" : comprehensions
# "TCH" : type checking optimizations
# "SIM" : code simplifications
target-version = "py39"

[tool.pytest.ini_options]
addopts = ["--import-mode=importlib"]
pythonpath = ["."]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ['setuptools']
build-backend = 'setuptools.build_meta'
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading
Loading