Skip to content

[19] Testing GH actions #20

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

Merged
merged 13 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from 12 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
22 changes: 15 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: Main workflow
name: CI

on:
push:
branches: [ "main", "develop"]
pull_request:
branches: [ "main", "develop"]
paths-ignore:
- "CHANGELOG.md"
- "README.md"

jobs:
linting:
Expand All @@ -15,11 +23,11 @@ jobs:
# Install a specific version of uv.
version: "0.6.2"

- name: Set up Python
run: uv python install

- name: Run black
run: uv run black --check src/wegen_utils
- name: Run ruff (black)
# Do not attempt to install the default dependencies, this is much faster.
# Run temporarily on a sub directory before the main restyling.
run: uv run --no-project --with "ruff==0.9.7" ruff format --check -n src/wegen_utils

- name: Run ruff (flake8)
run: uv run ruff src/wegen_utils
# Do not attempt to install the default dependencies, this is much faster.
run: uv run --no-project --with "ruff==0.9.7" ruff check src/
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ authors = [
]

requires-python = ">=3.11,<3.13"
# TODO: split the plotting dependencies into their own dep groups, they are not required.
dependencies = [ 'torch',
'numpy',
'astropy_healpix',
Expand All @@ -34,3 +35,37 @@ evaluate = "weathergen:evaluate"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[dependency-groups]
# The development dependencies
dev = [
"pytest",
"ruff==0.9.7"
]


# The linting configuration
[tool.ruff]

# Wide rows
line-length = 120

[tool.ruff.lint]
# All disabled until the code is formatted.
select = [
# pycodestyle
# "E",
# Pyflakes
# "F",
# pyupgrade
# "UP",
# flake8-bugbear
# "B",
# flake8-simplify
# "SIM",
# isort
# "I",
]
ignore = [

]
3 changes: 2 additions & 1 deletion src/wegen_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@


def stub():
"""Stub function to remove once the linters are in place."""
_logger.info("This is a stub function.")
return None
return 1
Loading