-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use setuptools-scm for dynamic version - Run FastAPI in a separate thread to provide liveness & readiness endpoints - Querying the root returns the name and version information of the package - Cleaned up dependencies - Enable more rules on ruff linter - Refactor project structure - Remove redundant linting
- Loading branch information
1 parent
1980592
commit 231b2ba
Showing
13 changed files
with
175 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
* | ||
!app.py | ||
!endpoints/ | ||
!requirements.txt | ||
!tests/ | ||
!/parser | ||
!/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,5 @@ RUN chgrp -R 0 /home/app && \ | |
|
||
USER app | ||
|
||
CMD ["python", "./app.py"] | ||
EXPOSE 5000 | ||
CMD ["python", "parser"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
# Mittaridatapumppu parser | ||
|
||
## Development setup | ||
|
||
```shell | ||
python -m venv venv | ||
. venv/bin/activate | ||
pip-sync | ||
pre-commit install | ||
``` |
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import parser | ||
|
||
if __name__ == "__main__": | ||
parser.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,41 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
requires = [ | ||
"setuptools>=60", | ||
"setuptools-scm>=8.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools_scm] | ||
version_file = "parser/_version.py" | ||
|
||
[tool.ruff] | ||
line-length = 120 | ||
target-version = "py311" | ||
select = ["E", "F", "B", "Q"] | ||
|
||
[project] | ||
name = "mittaridatapumppu-parser" | ||
description = "" | ||
description = """\ | ||
Python based microservice that consumes streaming data and converts it from \ | ||
raw format to something else as defined in corresponding parser modules \ | ||
obtained from device metadata \ | ||
""" | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
version = "v0.1.2" | ||
dynamic = ["version"] | ||
dependencies = [ | ||
"fvhiot[kafka]@https://github.com/ForumViriumHelsinki/FVHIoT-python/releases/download/v1.0.2/FVHIoT-1.0.2-py3-none-any.whl", | ||
"httpx", | ||
"kafka-python", | ||
"pydantic", | ||
"sentry_sdk" | ||
"fastapi ~= 0.109.0", | ||
"kafka-python ~= 2.0.2", | ||
"httpx ~= 0.26.0", | ||
"pydantic ~= 2.5.3", | ||
"sentry_asgi ~= 0.2.0", | ||
"uvicorn ~= 0.27.0" | ||
] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"autoflake", | ||
"autopep8", | ||
"black", | ||
"flake8", | ||
"gunicorn", | ||
"httpx", | ||
"isort", | ||
"pep8-naming", | ||
"pre-commit", | ||
"pydantic", | ||
"pytest", | ||
"pytest-asyncio", | ||
"pytest-cov", | ||
"pre-commit ~= 3.6.0", | ||
] | ||
test = [ | ||
"pytest", | ||
"requests" | ||
] #pip-compile --resolver=backtracking --extra test pyproject.toml | ||
"ruff ~= 0.1.15", | ||
"msgpack ~= 1.0.7" | ||
] |
Oops, something went wrong.