-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 83 replace poetry co by uv and ruff #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
13a46d2
583bb59
c68600a
0882a34
3365bb9
b2c53be
0ab0b53
5037de2
816458c
75de95c
dd42606
66dcbdb
fb801ee
eec02b9
1c4acaa
2fa0180
c1070d9
e3cf851
fd66094
42a3d29
1d95a12
eccadbc
1f51dd3
48d8c52
8849ae6
7224826
86155aa
2326784
49e8cd9
3d7d8b3
1b45d24
42e29d2
12149c5
8282338
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,9 @@ jobs: | |
python-version: ${{ matrix.version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install poetry | ||
poetry install | ||
curl --location --silent --show-error --fail https://astral.sh/uv/install.sh | sh | ||
export PATH="$HOME/.local/bin:$PATH" | ||
uv sync | ||
uv sync --dev | ||
Comment on lines
+26
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
- name: Run QA | ||
run: make qa |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,12 +27,10 @@ jobs: | |
python-version: '3.13' | ||
- name: Install dependencies | ||
run: | | ||
# First install Poetry in latest version, then install | ||
# build and twine in matching versions. The following | ||
# commands should not be run in a single line. | ||
pip install poetry | ||
pip install build twine | ||
poetry install | ||
curl --location --silent --show-error --fail https://astral.sh/uv/install.sh | sh | ||
export PATH="$HOME/.local/bin:$PATH" | ||
uv sync | ||
uv sync --dev | ||
Comment on lines
+32
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Siehe oben. |
||
- name: Run QA | ||
run: make qa | ||
- name: Get next version | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,40 @@ | ||
# Python folders | ||
__pycache__/ | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
*.egg-info/ | ||
*.egg/ | ||
.pytest_cache/ | ||
.mypy_cache/ | ||
.ruff_cache/ | ||
.pytype/ | ||
|
||
# Package managers | ||
.uv/ | ||
__pypackages__/ | ||
pip-wheel-metadata/ | ||
|
||
# Virtual environments | ||
venv/ | ||
env/ | ||
.venv/ | ||
.env/ | ||
|
||
# Build and distribution | ||
build/ | ||
dist/ | ||
|
||
# Testing and coverage | ||
.coverage | ||
.coverage.* | ||
htmlcov/ | ||
.tox/ | ||
|
||
# IDE | ||
.idea/ | ||
.vscode/ | ||
.ipynb_checkpoints/ | ||
Comment on lines
+34
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Das gehört hier IMHO nicht rein – das sollte in der globalen |
||
|
||
# OS generated files and folders | ||
.DS_Store |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,54 @@ | ||
qa: analyze test | ||
PACKAGE := eventsourcingdb | ||
TEST_DIR := tests | ||
PYTHON_DIRS := $(PACKAGE) $(TEST_DIR) | ||
|
||
qa: analyze typecheck security test | ||
|
||
analyze: | ||
@poetry run pylint eventsourcingdb tests | ||
@echo "Running code analysis..." | ||
@uv run ruff check $(PYTHON_DIRS) | ||
|
||
build: qa clean | ||
@echo "Build prepared." | ||
|
||
clean: | ||
@echo "Cleaning up..." | ||
@find . -type d -name __pycache__ -exec rm -rf {} + | ||
@find . -type f -name "*.pyc" -delete | ||
@find . -type f -name "*.pyo" -delete | ||
@find . -type f -name "*.pyd" -delete | ||
@find . -type f -name ".coverage" -delete | ||
@find . -type d -name "*.egg-info" -exec rm -rf {} + | ||
@find . -type d -name "*.egg" -exec rm -rf {} + | ||
@find . -type d -name ".pytest_cache" -exec rm -rf {} + | ||
@find . -type d -name ".mypy_cache" -exec rm -rf {} + | ||
@find . -type d -name ".pyright" -exec rm -rf {} + | ||
@find . -type d -name ".ruff_cache" -exec rm -rf {} + | ||
@rm -rf build/ dist/ .coverage htmlcov/ .venv/ | ||
|
||
coverage: | ||
@echo "Checking test coverage..." | ||
@uv run pytest --cov=$(PACKAGE) --cov-report=term-missing $(TEST_DIR) | ||
|
||
format: | ||
@poetry run autopep8 --in-place --aggressive --max-line-length=100 --recursive eventsourcingdb tests | ||
|
||
@echo "Formatting code..." | ||
@uv run ruff format $(PYTHON_DIRS) | ||
|
||
lock: | ||
@poetry lock | ||
@echo "Updating dependency lock..." | ||
@uv run uv lock | ||
|
||
test: | ||
@poetry run pytest --maxfail=1 | ||
security: | ||
@echo "Running security checks..." | ||
@uv run bandit -r $(PACKAGE) -c pyproject.toml | ||
|
||
clean: | ||
test: | ||
@echo "Running tests..." | ||
@uv run pytest --maxfail=1 | ||
|
||
build: qa clean | ||
typecheck: | ||
@uv add pyright --dev | ||
@echo "Running type checking..." | ||
@uv run pyright $(PACKAGE) | ||
|
||
.PHONY: analyze build clean format lock qa test | ||
.PHONY: analyze build coverage format help lock qa security test typecheck clean | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Da das jetzt hier ja ein bisschen länger wird, sollten wir das umbrechen (siehe zB hier: https://github.com/thenativeweb/eventsourcingdb-client-dotnet/blob/main/Makefile#L35-L40). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,38 @@ | ||
from .bound import Bound, BoundType | ||
from .client import Client | ||
from .container import Container | ||
from .event import Event, EventCandidate | ||
from .errors import ClientError, CustomError, InternalError, ServerError, ValidationError | ||
from .event import Event, EventCandidate | ||
from .observe_events import ( | ||
IfEventIsMissingDuringObserve, | ||
ObserveEventsOptions, | ||
ObserveFromLatestEvent, | ||
IfEventIsMissingDuringObserve | ||
) | ||
from .read_events import ReadEventsOptions, ReadFromLatestEvent, IfEventIsMissingDuringRead, Order | ||
from .read_event_types import EventType | ||
from .write_events import Precondition, IsSubjectOnEventId, IsSubjectPristine | ||
|
||
from .read_events import IfEventIsMissingDuringRead, Order, ReadEventsOptions, ReadFromLatestEvent | ||
from .write_events import IsSubjectOnEventId, IsSubjectPristine, Precondition | ||
|
||
__all__ = [ | ||
'Bound', 'BoundType', | ||
'Client', | ||
'Container', | ||
'Event', 'EventCandidate', | ||
'EventType', | ||
'ObserveEventsOptions', 'ObserveFromLatestEvent', 'IfEventIsMissingDuringObserve', | ||
'Precondition', 'IsSubjectOnEventId', 'IsSubjectPristine', | ||
'ReadEventsOptions', 'ReadFromLatestEvent', 'IfEventIsMissingDuringRead', 'Order', | ||
'ClientError', 'CustomError', 'InternalError', 'ServerError', 'ValidationError', | ||
"Bound", | ||
"BoundType", | ||
"Client", | ||
"ClientError", | ||
"Container", | ||
"CustomError", | ||
"Event", | ||
"EventCandidate", | ||
"EventType", | ||
"IfEventIsMissingDuringObserve", | ||
"IfEventIsMissingDuringRead", | ||
"InternalError", | ||
"IsSubjectOnEventId", | ||
"IsSubjectPristine", | ||
"ObserveEventsOptions", | ||
"ObserveFromLatestEvent", | ||
"Order", | ||
"Precondition", | ||
"ReadEventsOptions", | ||
"ReadFromLatestEvent", | ||
"ServerError", | ||
"ValidationError", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Die sollte nicht gelöscht werden.