Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/build-test-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions:
contents: write

jobs:

check-version-txt:
runs-on: ubuntu-latest
steps:
Expand Down
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: /bin/bash -x run.sh lint:ci

- name: Tests (run.sh test:ci)
run: /bin/bash -x run.sh test:ci
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,4 @@ 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$

# - 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"
}
]
}
}
17 changes: 0 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Execute the "targets" in this file with `make <target>` e.g., `make test`.
#
# You can also run multiple in sequence, e.g. `make clean lint test serve-coverage-report`

build:
Expand All @@ -20,18 +18,6 @@ lint:
lint-ci:
bash run.sh lint:ci

publish-prod:
bash run.sh publish:prod

publish-test:
bash run.sh publish:test

release-prod:
bash run.sh release:prod

release-test:
bash run.sh release:test

serve-coverage-report:
bash run.sh serve-coverage-report

Expand All @@ -43,6 +29,3 @@ test-quick:

test:
bash run.sh run-tests

test-wheel-locally:
bash run.sh test:wheel-locally
26 changes: 0 additions & 26 deletions README 2.md

This file was deleted.

Loading
Loading