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
16 changes: 11 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,20 @@ jobs:
run: |
pip install poetry

- name: Configure Poetry
run: |
poetry config virtualenvs.create false
- name: Cache Poetry virtualenv and dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.cache/pip
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-

- name: Install dependencies
run: |
make install
make install-dev

- name: Run linting checks
run: |
make check-pylint
make check-pylint
25 changes: 19 additions & 6 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,27 @@ jobs:
run: |
pip install poetry

- name: Configure Poetry
run: |
poetry config virtualenvs.create false

- name: Cache Poetry virtualenv and dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.cache/pip
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-

- name: Cache pre-commit
uses: actions/cache@v4
with:
path: |
~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Install dependencies
run: |
make install
make install-dev

- name: Run Pre-commit checks
run: |
make precommit
make precommit
16 changes: 11 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,20 @@ jobs:
run: |
pip install poetry

- name: Configure Poetry
run: |
poetry config virtualenvs.create false
- name: Cache Poetry virtualenv and dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.cache/pip
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-

- name: Install dependencies
run: |
make install
make install-dev

- name: Run tests
run: |
make test
make test
23 changes: 12 additions & 11 deletions .make/.bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@

[tool.bumpversion]
current_version = "0.4.0"
current_version = "0.7.1"
commit = true
message = "Makefile version {new_version} released."
tag = true
tag_name = "makefile-{new_version}"
parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+) (?P<releaseTime>.*)?'
serialize = [
"{major}.{minor}.{patch}",
"{utcnow:%Y-%m-%dT%H:%M:%SZ}"
"{major}.{minor}.{patch}"
]

[[tool.bumpversion.files]]
filename = "CHANGES_MAKEFILE.md"
search = '''
[Unreleased](https://github.com/RolnickLab/lab-advanced-template/tree/main) (latest)
-------------------------------------------------------------------------------------
## [Unreleased](https://github.com/RolnickLab/lab-advanced-template/tree/main) (latest)

______________________________________________________________________
'''
replace = '''
[Unreleased](https://github.com/RolnickLab/lab-advanced-template/tree/main) (latest)
-------------------------------------------------------------------------------------
## [Unreleased](https://github.com/RolnickLab/lab-advanced-template/tree/main) (latest)

______________________________________________________________________

<!-- (New changes here in list form) -->

[//]: # (New changes here in list form)
## [{new_version}](https://github.com/RolnickLab/lab-advanced-template/tree/makefile-{new_version}) ({utcnow:%Y-%m-%d})

[{new_version}](https://github.com/RolnickLab/lab-advanced-template/tree/makefile-{new_version}) ({utcnow:%Y-%m-%d})
-------------------------------------------------------------------------------------
______________________________________________________________________
'''

[[tool.bumpversion.files]]
Expand Down
54 changes: 44 additions & 10 deletions .make/CHANGES_MAKEFILE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,52 @@
# CHANGES.md

[Unreleased](https://github.com/RolnickLab/lab-advanced-template/tree/main) (latest)
-------------------------------------------------------------------------------------
## [Unreleased](https://github.com/RolnickLab/lab-advanced-template/tree/main) (latest)

[//]: # (New changes here in list form)
______________________________________________________________________

[0.4.0](https://github.com/RolnickLab/lab-advanced-template/tree/makefile-0.4.0) (2024-10-30)
-------------------------------------------------------------------------------------
<!-- (New changes here in list form) -->

* Add cyclomatic complexity check target
## [0.7.1](https://github.com/RolnickLab/lab-advanced-template/tree/makefile-0.7.1) (2025-09-17)

[0.3.0](https://github.com/RolnickLab/lab-advanced-template/tree/makefile-0.3.0) (2024-10-30)
-------------------------------------------------------------------------------------
______________________________________________________________________

* Add utilities to track makefile versions
* Fix many of the targets relating to standalone `poetry` installation
<!-- (New changes here in list form) -->

## [0.7.0](https://github.com/RolnickLab/lab-advanced-template/tree/makefile-0.7.0) (2025-09-10)

______________________________________________________________________

- Add `mdformat` tool for markdown linting
- Modularize the Makefile structure, allowing to choose which tools are available
- Add tests for the Makefile

## [0.6.0](https://github.com/RolnickLab/lab-advanced-template/tree/makefile-0.6.0) (2025-05-29)

______________________________________________________________________

- Improve venv support
- Add venv remove target
- Refactor `poetry-install-auto` to really be automatic
- Add `mamba-install` target as an alternative/complement to conda for local dev
- Add `autoflake`, `autopep8` and `ruff` targets
- Fix some typos that caused targets to fail

## [0.5.0](https://github.com/RolnickLab/lab-advanced-template/tree/makefile-0.5.0) (2025-03-11)

______________________________________________________________________

- Add venv support
- Update and fix `poetry-install-auto` target

## [0.4.0](https://github.com/RolnickLab/lab-advanced-template/tree/makefile-0.4.0) (2024-10-30)

______________________________________________________________________

- Add cyclomatic complexity check target

## [0.3.0](https://github.com/RolnickLab/lab-advanced-template/tree/makefile-0.3.0) (2024-10-30)

______________________________________________________________________

- Add utilities to track makefile versions
- Fix many of the targets relating to standalone `poetry` installation
8 changes: 4 additions & 4 deletions .make/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# files to include.
########################################################################################
PROJECT_PATH := $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
MAKEFILE_VERSION := 0.4.0
MAKEFILE_VERSION := 0.7.1
BUMP_TOOL := bump-my-version
BUMP_CONFIG_FILE := $(PROJECT_PATH).bumpversion.toml

Expand Down Expand Up @@ -73,12 +73,12 @@ dry: ## Add the dry target for a preview of changes; ex. `make bump-major dry`

.PHONY: bump-major
bump-major: ## Bump makefile major version <X.0.0>
$(BUMP_TOOL) $(BUMP_ARGS) bump major --config-file $(BUMP_CONFIG_FILE)
$(BUMP_TOOL) bump $(BUMP_ARGS) major --config-file $(BUMP_CONFIG_FILE)

.PHONY: bump-minor
bump-minor: ## Bump makefile minor version <0.X.0>
$(BUMP_TOOL) $(BUMP_ARGS) bump minor --config-file $(BUMP_CONFIG_FILE)
$(BUMP_TOOL) bump $(BUMP_ARGS) minor --config-file $(BUMP_CONFIG_FILE)

.PHONY: bump-patch
bump-patch: ## Bump makefile patch version <0.0.X>
$(BUMP_TOOL) $(BUMP_ARGS) bump patch --config-file $(BUMP_CONFIG_FILE)
$(BUMP_TOOL) bump $(BUMP_ARGS) patch --config-file $(BUMP_CONFIG_FILE)
22 changes: 17 additions & 5 deletions .make/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,28 @@

This folder contains the base makefile targets.

It should not be modified outside of the [Template's repository](https://github.com/RolnickLab/lab-advanced-template).
It should not be modified outside the [Template's repository](https://github.com/RolnickLab/lab-advanced-template).

If there is a problem with the contents of these targets, please open an issue [here](https://github.com/RolnickLab/lab-advanced-template/issues).
If there is a problem with the contents of these targets, please open an
issue [here](https://github.com/RolnickLab/lab-advanced-template/issues).

If you know how to fix the problem, please also consider opening a pull request with
If you know how to fix the problem, please also consider opening a pull request with
your proposed solution.

You can always override the faulty targets located here by creating new targets
with the same names inside [Makefile.targets](../Makefile.targets).

The Makefile and `bump-my-version` related files in this directory are to help with
change tracking for the makefile itself. If you are using this makefile as part of a
template in another repository
change tracking for the makefile itself. If you are using this makefile as part of a
template in another repository, you won't have to interact with them.

## Tests

Makefile tests can be found in the [.make/tests/](tests) folder. Current tests are
essentially bash scripts to test the different makefile targets.

These should only be run when modifying the makefiles inside the
[Template's repository](https://github.com/RolnickLab/lab-advanced-template).

They should never be run in a project implemented from the template, as they could cause
side effects to your project.
Loading