Skip to content

Commit 5b44d54

Browse files
Update bootstraping
1 parent 8da2e75 commit 5b44d54

File tree

3 files changed

+34
-27
lines changed

3 files changed

+34
-27
lines changed

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: ./.github/actions/setup-env
2828
- name: Install doc dependencies
2929
run: |
30-
poetry install --with doc --no-interaction
30+
poetry install --with docs --no-interaction
3131
- name: List directories
3232
run: |
3333
ls -la

Makefile

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,54 @@
1+
POETRY_HOME := $(HOME)/.poetry
2+
POETRY := $(POETRY_HOME)/bin/poetry
3+
14
.PHONY: pre-install
25
pre-install:
36
@echo "🐍 Checking if Python is installed"
47
@command -v python3 >/dev/null 2>&1 || { echo >&2 "Python is not installed. Aborting."; exit 1; }
5-
@echo "📦 Checking if pip is installed"
6-
@command -v pip3 >/dev/null 2>&1 || { echo >&2 "pip is not installed. Installing pip."; python3 -m ensurepip; }
7-
@echo "📦 Checking if Poetry is installed"
8-
@command -v poetry >/dev/null 2>&1 || { echo >&2 "Poetry is not installed. Installing Poetry."; pip3 install poetry; }
98
@echo "🐍 Checking Python version"
109
@python3 --version | grep -E "Python 3\.(10|[1-9][1-9])" >/dev/null 2>&1 || { echo >&2 "Python version 3.10 or higher is required. Aborting."; exit 1; }
11-
@echo "📦 Checking Poetry version"
12-
@poetry --version | grep -E "Poetry (1\.[8-9]\.[5-9]|[2-9]\.[0-9])" >/dev/null 2>&1 || { echo >&2 "Poetry version > 1.8.4 is required. Aborting."; exit 1; }
10+
@echo "📦 Checking if Poetry is installed"
11+
@command -v poetry >/dev/null 2>&1 || { echo >&2 "Poetry is not installed. Installing Poetry."; curl -sSL https://install.python-poetry.org | POETRY_HOME=$(POETRY_HOME) python3 -; }
1312

1413
.PHONY: install
15-
install: ## Install the poetry environment and install the pre-commit hooks
16-
pre-install
14+
install: pre-install ## Install the poetry environment and install the pre-commit hooks
15+
@echo "📦 Installing dependencies with Poetry"
16+
@$(POETRY) install --with core
17+
@echo "🔧 Installing pre-commit hooks"
18+
@$(POETRY) run pre-commit install
19+
@echo "🐚 Activating virtual environment"
20+
@$(POETRY) shell
21+
22+
.PHONY: full-install
23+
full-install: pre-install ## Install the poetry environment and install the pre-commit hooks
1724
@echo "📦 Installing dependencies with Poetry"
18-
@poetry install
25+
@$(POETRY) install --with core,docs,dev
1926
@echo "🔧 Installing pre-commit hooks"
20-
@poetry run pre-commit install
27+
@$(POETRY) run pre-commit install
2128
@echo "🐚 Activating virtual environment"
22-
@poetry shell
29+
@$(POETRY) shell
2330

2431
.PHONY: check
2532
check: ## Run code quality tools.
2633
@echo "🛠️ Running code quality checks"
2734
@echo "🔍 Checking Poetry lock file consistency"
28-
@poetry check --lock
35+
@$(POETRY) check --lock
2936
@echo "🚨 Linting code with pre-commit"
30-
@poetry run pre-commit run -a
37+
@$(POETRY) run pre-commit run -a
3138

3239
.PHONY: check-plus
3340
check-plus: check ## Run additional code quality tools.
3441
@echo "🔍 Checking code formatting with black
35-
@poetry run black --check ."
42+
@$(POETRY) run black --check ."
3643
@echo "⚙️ Static type checking with mypy"
37-
@poetry run mypy
44+
@$(POETRY) run mypy
3845
@echo "🔎 Checking for obsolete dependencies"
39-
@poetry run deptry .
46+
@$(POETRY) run deptry .
4047

4148
.PHONY: build
4249
build: clean-build ## Build wheel file using poetry
4350
@echo "🚀 Creating wheel file"
44-
@poetry build
51+
@$(POETRY) build
4552

4653
.PHONY: clean-build
4754
clean-build: ## clean build artifacts
@@ -50,31 +57,31 @@ clean-build: ## clean build artifacts
5057
.PHONY: publish
5158
publish: ## publish a release to pypi.
5259
@echo "🚀 Publishing: Dry run."
53-
@poetry config pypi-token.pypi $(PYPI_TOKEN)
54-
@poetry publish --dry-run
60+
@$(POETRY) config pypi-token.pypi $(PYPI_TOKEN)
61+
@$(POETRY) publish --dry-run
5562
@echo "🚀 Publishing."
56-
@poetry publish
63+
@$(POETRY) publish
5764

5865
.PHONY: build-and-publish
5966
build-and-publish: build publish ## Build and publish.
6067

6168
.PHONY: doc-test
6269
doc-test: ## Test if documentation can be built without warnings or errors
63-
@poetry run mkdocs build -f docs/mkdocs.yml -d _build -s
70+
@$(POETRY) run mkdocs build -f docs/mkdocs.yml -d _build -s
6471

6572
.PHONY: doc-build
6673
doc-build: ## Build the documentation
67-
@poetry run mkdocs build -f docs/mkdocs.yml -d _build
74+
@$(POETRY) run mkdocs build -f docs/mkdocs.yml -d _build
6875

6976
.PHONY: doc-serve
7077
doc-serve: ## Build and serve the documentation
71-
@poetry run mkdocs serve -f docs/mkdocs.yml
78+
@$(POETRY) run mkdocs serve -f docs/mkdocs.yml
7279

7380
.PHONY: format
7481
format: ## Format code with black and isort
7582
@echo "🎨 Formatting code"
76-
@poetry run black .
77-
@poetry run isort .
83+
@$(POETRY) run black .
84+
@$(POETRY) run isort .
7885

7986
.PHONY: clean
8087
clean: clean-build ## Clean up build artifacts and cache files

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pre-commit = "^4.0.1"
3232
ruff = "^0.7.2"
3333
isort = "^5.13.2"
3434

35-
[tool.poetry.group.doc.dependencies]
35+
[tool.poetry.group.docs.dependencies]
3636
mkdocs = "^1.6.1"
3737
mkdocs-material = "^9.5.43"
3838
mkdocs-material-extensions = "^1.3.1"

0 commit comments

Comments
 (0)