Skip to content
Open
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
30 changes: 0 additions & 30 deletions .cruft.json

This file was deleted.

3 changes: 0 additions & 3 deletions .env.example → .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,9 @@ PYTHONSTARTUP='__CWD__/etc/pythonstartup.py'

# caching
CACHE_DIR='__CWD__/var/cache/'
BLACK_CACHE_DIR='__CWD__/var/cache/black'
IPYTHON_CACHE_DIR='__CWD__/var/cache/ipython'
MYPY_CACHE_DIR='__CWD__/var/cache/mypy'
PRE_COMMIT_HOME='__CWD__/var/cache/pre-commit'
PYLINTHOME='__CWD__/var/cache/pylint'
RUFF_CACHE_DIR='__CWD__/var/cache/ruff' # use python -m ruff

# debugging
# used by python-interpreter, cfr. https://docs.python.org/3/using/cmdline.html#environment-variables
Expand Down
15 changes: 3 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
version: 2

updates:

- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "monthly"

- package-ecosystem: pip
directory: "/.github/workflows"
schedule:
interval: "monthly"

- package-ecosystem: pip
directory: "/docs"
schedule:
interval: "monthly"

- package-ecosystem: pip
directory: "/"
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
versioning-strategy: lockfile-only
Expand Down
2 changes: 1 addition & 1 deletion .github/funding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# - https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository
# - https://docs.github.com/en/sponsors/getting-started-with-github-sponsors/about-github-sponsors

github: [{ { cookiecutter.github_user } }]
github: [libranet]
64 changes: 64 additions & 0 deletions .github/workflows/linting copy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Linting

env:
POETRY_VERSION: "1.8.4"

on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- main

permissions:
contents: read

jobs:
run-tests:
name: Python linters
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Set up Poetry
run: |
pip install poetry==${{ env.POETRY_VERSION}}

- name: Install
run: |
make install

- name: Flake8
run: |
make flake8

- name: Ruff
run: |
make ruff-check

- name: Pylint
run: |
make pylint

- name: Mypy
run: |
make mypy

- name: Pyroma
run: |
make pyroma

- name: Check poetry
run: |
make poetry-check
make poetry-lock-check
72 changes: 34 additions & 38 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Linting

env:
POETRY_VERSION: "1.8.4"

on:
pull_request:
types: [opened, reopened, synchronize]
Expand All @@ -13,52 +10,51 @@ on:
permissions:
contents: read


jobs:
# see https://docs.astral.sh/uv/guides/integration/github/
run-tests:
name: Python linters
runs-on: ubuntu-latest
timeout-minutes: 5

strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Poetry
run: |
pip install poetry==${{ env.POETRY_VERSION}}
- name: Remove sitecustomize.py
run: |
sudo rm -f /usr/lib/python3.*/sitecustomize.py
sudo rm -f /etc/python3.*/sitecustomize.py

- name: Install
run: |
make install
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
version: "latest"

- name: Flake8
run: |
make flake8
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Ruff
run: |
make ruff-check
- name: Install the project
run: uv sync --all-groups

- name: Pylint
run: |
make pylint
- name: Pre-commit
run: uv run pre-commit run --all-files

- name: Mypy
run: |
make mypy
# - name: Ruff check
# run: uv run ruff check src tests

- name: Pyroma
run: |
make pyroma
# - name: Pylint
# run: uv run pylint src

- name: Check poetry
run: |
make poetry-check
make poetry-lock-check
- name: Pyroma
run: uv run pyroma .
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
# distribution / packaging
/dist/

/.cookiecutter.json

# .env can contain secrets
/.env

Expand Down
22 changes: 22 additions & 0 deletions .just/dir-structure.justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# See ../justfile


# initialize dir-structure, create dirs
[group: 'dir-structure']
create-dirs:
@echo -e "In current working dir: ${PWD}"
mkdir -p var ;\
mkdir -p var/cache ;\
mkdir -p var/cache/vscode ;\
mkdir -p var/log ;\
mkdir -p var/static
mkdir -p var/tmp


# symlinks to venv-dirs to make bin/python work
[group: 'dir-structure']
symlink-venv-dirs:
ln -sf ${VENV_DIR}/bin ;\
ln -sf ${VENV_DIR}/lib ;\
# ln -sf ${VENV_DIR}/lib64 ;\
ln -sf ${VENV_DIR}/pyvenv.cfg
29 changes: 29 additions & 0 deletions .just/dotenv.justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# See ../makefile

# Source .env.template, because .env might not yet exist.
# -include .env.template

# Source .env, if it exists. This Overrides any env-vars sourced in .env.template.
# -include .env


# instantiate the dotenv-file (no override)
# cp --backup creates .env~, but will overwrite this next time.
# safest way, is to not overwrite existing .env-files, manual intervention needed.
[group: 'dotenv']
dotenv-install-from-template:
@echo -e "Copying .env.template to .env" ;\
cp -n .env.template .env ;\
echo "Please review any credentials in the .env-file."


# replace placeholder __CDW__ with current working directory
[group: 'dotenv']
dotenv-set-basedir:
@echo -e "Replacing string __CWD__ -> $(PWD)" ;\
sed -i 's@__CWD__@'"$(PWD)"'@' .env


# install .env-file from .env.template
[group: 'dotenv']
dotenv-install: dotenv-install-from-template dotenv-set-basedir
Loading