Skip to content

Commit fc496e6

Browse files
committed
refactoring next part
1 parent 7b8114a commit fc496e6

6 files changed

Lines changed: 53 additions & 59 deletions

File tree

.github/dependabot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SPDX-FileCopyrightText: 2026 German Aerospace Center (DLR)
2+
# SPDX-License-Identifier: CC0-1.0
3+
#
4+
# Please see the documentation for all configuration options:
5+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
6+
7+
version: 2
8+
updates:
9+
# Maintain dependencies for Python packages
10+
- package-ecosystem: pip
11+
directory: /
12+
schedule:
13+
interval: monthly
14+
15+
# Maintain dependencies inside uv lock file
16+
- package-ecosystem: uv
17+
directory: /
18+
schedule:
19+
interval: monthly
20+
21+
# Maintain dependencies for GitHub actions
22+
- package-ecosystem: github-actions
23+
directory: /
24+
schedule:
25+
interval: monthly
26+
27+
# Maintain dependencies for pre-commit config
28+
- package-ecosystem: pre-commit
29+
directory: /
30+
schedule:
31+
interval: monthly

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions/checkout@v6
2828
- uses: actions/setup-node@v6
2929
- name: Install dependencies
30-
run: npm install markdownlint-cli2
30+
run: npm install --no-save "markdownlint-cli2@0.22.0"
3131
- name: Start type checking
3232
run: bash ./dev lint-doc
3333

@@ -155,6 +155,8 @@ jobs:
155155
build-pages:
156156
needs: [lint-code, lint-doc, lint-scripts, mypy, coverage, license-check]
157157
runs-on: ubuntu-latest
158+
environment:
159+
DEPLOY: true
158160
steps:
159161
- uses: actions/checkout@v6
160162
- name: Install uv

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ repos:
77
hooks:
88
- id: flake8
99
- repo: https://github.com/pre-commit/mirrors-mypy
10-
rev: v1.19.1
10+
rev: v1.20.0
1111
hooks:
1212
- id: mypy

README.md

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -29,46 +29,16 @@ They offer a more user-friendly interface and comprehensive guides to get you st
2929

3030
## Requirements
3131

32-
### Python > 3.10
33-
34-
```bash
35-
sudo apt install python<version>
36-
#If not available you can add latest versions with
37-
sudo add-apt-repository ppa:deadsnakes/ppa
38-
```
39-
40-
### Venv
41-
42-
```bash
43-
#Install venv
44-
sudo apt install python<version>-venv
45-
```
46-
47-
### Virtualenv (alternative to venv)
48-
49-
```bash
50-
#python 3.10 or later
51-
which python
52-
#virtualenv or venv
53-
pip install -U virtualenv
54-
```
32+
- Python 3.10 or later
33+
`which python`
34+
- [uv](https://docs.astral.sh/uv/)
35+
`curl -LsSf https://astral.sh/uv/install.sh | sh`
5536

5637
## Install
5738

5839
```bash
59-
# create virtual environment
60-
virtualenv -p $(which python<version>) .venv
61-
# or
62-
python<version> -m venv .venv
63-
64-
# activate our virtual environment
65-
source .venv/bin/activate
66-
67-
# update pip (optional)
68-
python -m pip install -U pip
69-
70-
# install
71-
./dev install -U -e ".[all]"
40+
# create virtual environment and install dependencies
41+
./dev install
7242
```
7343

7444
## Helpers

dev

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ function version() {
9393

9494
function versions() {
9595
info "versions"
96-
# info "$(python --version)" <- not necessarily the uv python
97-
info "$(uv --version)"
96+
if ! command -v docker > /dev/null 2>&1; then
97+
warn "uv not found, skipping uv version"
98+
else
99+
info "uv version: $(uv --version)"
100+
fi
98101
if ! command -v docker > /dev/null 2>&1; then
99102
warn "docker not found, skipping docker version"
100103
else
@@ -116,13 +119,7 @@ function install() {
116119
curl -LsSf https://astral.sh/uv/install.sh | sh
117120
fi
118121
info "install package"
119-
uv sync --editable --all-extras
120-
info "install markdown linter"
121-
if command -v npm > /dev/null 2>&1; then
122-
npm install --no-save markdownlint-cli2
123-
else
124-
warn "npm not found, skipping markdownlint-cli2 installation"
125-
fi
122+
uv sync --all-extras
126123
}
127124

128125
function clean() {
@@ -253,14 +250,14 @@ function lint-doc() {
253250
info "lint documentation"
254251
# use markdownlint from David Anson (based on nodejs)
255252
# https://github.com/DavidAnson/markdownlint
256-
npm exec "markdownlint-cli2@0.22.0" "${DOC_ROOT}/**/*.md" "${PROJECT_ROOT}/README.md"
253+
npm exec "markdownlint-cli2@0.22.0" -- "${DOC_ROOT}/**/*.md" "${PROJECT_ROOT}/README.md"
257254
}
258255

259256
function lint-scripts() {
260257
info "lint bash scripts"
261-
info "shellcheck $(shellcheck --version | head -n 2 | tail -n 1)"
262-
shellcheck --external-sources --shell bash --source-path "${PROJECT_ROOT}" "${PROJECT_ROOT}/dev"
263-
shellcheck --external-sources --shell bash --source-path "${SCRIPTS_ROOT}" "${SCRIPTS_ROOT}/"*.sh
258+
info "shellcheck $(uv run shellcheck --version | head -n 2 | tail -n 1)"
259+
uv run shellcheck --external-sources --shell bash --source-path "${PROJECT_ROOT}" "${PROJECT_ROOT}/dev"
260+
uv run shellcheck --external-sources --shell bash --source-path "${SCRIPTS_ROOT}" "${SCRIPTS_ROOT}/"*.sh
264261
}
265262

266263
function mypy() {
@@ -328,10 +325,6 @@ function safety-check() {
328325
info "check dependencies for known security vulnerabilities"
329326
# main only no dev dependencies etc.
330327
uv run tox --recreate -e safety
331-
# alternative
332-
#uv pip install -U safety
333-
#safety check
334-
##uv pip uninstall safety
335328
}
336329

337330

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
# package, this name will be registered for you. It will determine how
77
# users can install this project, e.g.:
88
#
9-
# $ uv sync fl-demonstrator
10-
#
11-
# And where it will live on PyPI: https://pypi.org/project/fl-demonstrator/
9+
# $ uv add "fl-demonstrator @ git+https://github.com/DLR-KI/fl-demonstrator.git"
1210
#
1311
# There are some restrictions on what makes a valid project name
1412
# specification here:
@@ -133,7 +131,7 @@ dependencies = [ # Optional
133131
# dependencies). Users will be able to install these using the "extras"
134132
# syntax, for example:
135133
#
136-
# $ uv sync --editable --all-extras
134+
# $ uv sync --all-extras
137135
#
138136
# Similar to `dependencies` above, these must be valid existing
139137
# projects.

0 commit comments

Comments
 (0)