Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
146 changes: 0 additions & 146 deletions .github/workflows/build-test-publish.yaml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/ci-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: {}

permissions:
contents: read

jobs:
ci:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.7.19"
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock

- name: Install Python
run: uv python install

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

- name: Lint (run.sh lint:ci)
run: uv run /bin/bash -x run.sh lint:ci

- name: Tests (run.sh test:ci)
run: uv run /bin/bash -x run.sh test:ci
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,12 @@ __marimo__/

.DS_Store

tests/*
test-reports/*
tests/data/*
!tests/data/.gitkeep # leave a marker so the empty dir is in the repo

src/cosinor_lite/*.egg-info/
src/cosinor_lite/states_info.py
src/cosinor_lite/cities.json
"README 2.md"

.DS_Store
.DS_Store
118 changes: 26 additions & 92 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,106 +1,40 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
# Fails if there are any ">>>>>" lines in files due to merge conflicts.
- id: check-merge-conflict
# Trims trailing whitespace. Allow a single space on the end of .md lines for hard line breaks.
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
# Makes sure files end in a newline and only a newline;
- id: end-of-file-fixer
# Attempts to load all TOML files to verify syntax.
- id: check-toml
# Attempts to load all yaml files to verify syntax; unsafe: only check syntax, do not load yaml
- id: check-yaml
args: ["--unsafe"]
# Check for symlinks that do not point to anything.
- id: check-symlinks
# Fail if staged files are above a certain size.
# To add a large file, use 'git lfs track <file>; git add <file> to track large files with
# git-lfs rather than commiting them directly to the git history
- id: check-toml
- id: check-added-large-files
args: ["--maxkb=500"]

# HALT! Before you exclude a large file and commit it, forever
# bloating our repo size, did you:
# (1) use a CLI tool like imageoptim to compress them if they are images
# (2) think hard about whether using DVC or git-lfs is more appropriate
# for the file--such as in the case of CSV files or other data
# This can be confusing. Reach out for help in our chat to help decide
# how to deal adding these large files you have :)
exclude: |
(?x)(
^example/large/file.csv|
^example/large/sklearn-model.pkl
)
# Sort requirements in requirements.txt files.
- id: requirements-txt-fixer
# Prevent addition of new git submodules.
- id: forbid-new-submodules
# Prevent committing directly to trunk (since Bitbucket wants us to pay for this feature)
- id: no-commit-to-branch
args: ["--branch=main"]
# Detects the presence of private keys
- id: detect-private-key

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.261"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.6
hooks:
- id: ruff
args: [--exit-non-zero-on-fix, --config=./pyproject.toml]

# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: "v1.2.0"
# hooks:
# - id: mypy
# args:
# [
# --no-strict-optional,
# --ignore-missing-imports,
# --config-file=./pyproject.toml,
# ]

# - repo: https://github.com/psf/black
# rev: 23.1.0
# hooks:
# - id: black
# args:
# - --config=./pyproject.toml
args: [--fix]
exclude: ^app\.py$
- id: ruff-format

# - repo: https://github.com/PyCQA/pylint
# rev: v2.16.3
# hooks:
# - id: pylint
# args:
# - --rcfile=./pyproject.toml
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
exclude: "^(app\\.py$|tests/)"

# - repo: https://github.com/PyCQA/flake8
# rev: 6.0.0
# hooks:
# - id: flake8
# args:
# - --toml-config=./pyproject.toml
# additional_dependencies:
# - radon
# - flake8-docstrings
# - Flake8-pyproject
- repo: https://github.com/kynan/nbstripout
rev: 0.8.2
hooks:
- id: nbstripout

# - repo: https://github.com/pycqa/isort
# rev: 5.12.0
# hooks:
# - id: isort
# args:
# - --settings-path=./pyproject.toml
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets

# - repo: https://github.com/PyCQA/autoflake
# rev: v2.0.1
# hooks:
# - id: autoflake
# args:
# - --in-place
# - --remove-all-unused-imports
# - --remove-unused-variable
# - --ignore-init-module-imports
- repo: https://github.com/econchick/interrogate
rev: 1.7.0
hooks:
- id: interrogate
args: ["--fail-under=70", "-vvv"]
files: "^src/"
19 changes: 14 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,23 @@
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
// ─── Ruff: formatter, linter, import sorter ────────
// Formatting + code actions on save
// "[python]": {
// "editor.defaultFormatter": "charliermarsh.ruff", // Ruff formats & sorts imports
// "editor.formatOnSave": true,
// "editor.codeActionsOnSave": {
// "source.organizeImports": "explicit", // Ruff handles import‑sorting:contentReference[oaicite:0]{index=0}
// "source.fixAll": "explicit" // Ruff auto‑fixes lint on save:contentReference[oaicite:1]{index=1}
// }
// },
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff", // Ruff formats & sorts imports
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit", // Ruff handles import‑sorting:contentReference[oaicite:0]{index=0}
"source.fixAll": "explicit" // Ruff auto‑fixes lint on save:contentReference[oaicite:1]{index=1}
"source.fixAll": true,
"source.fixAll.ruff": true,
"source.organizeImports": true
}
},
}
// ─── Ty: super‑fast type checking / language server ─
// After installing the “ty” VS Code extension:
// "python.languageServer": "None", // disable Pylance’s LS to avoid clashing:contentReference[oaicite:2]{index=2}
Expand All @@ -38,4 +47,4 @@
"color": "lightgreen"
}
]
}
}
Loading