Skip to content
Open
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ monitoring/uss_qualifier/output/*
monitoring/uss_qualifier/htmlcov/*
monitoring/mock_uss/output/*
**/__pycache__
dist/*
28 changes: 28 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Based on https://github.com/denkiwakame/py-tiny-pkg/blob/main/.github/workflows/pub.yml
# To create a release, see https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository

name: publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup-python
uses: actions/setup-python@v3
with:
python-version: "3.x"
architecture: "x64"
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: build sdist(tarball) and bdist(wheel) to dist/
run: uv build
- name: publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/test_publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Based on https://github.com/denkiwakame/py-tiny-pkg/blob/main/.github/workflows/testpub.yml

name: publish-test

on:
push:
tags:
- "*"

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup-python
uses: actions/setup-python@v3
with:
python-version: "3.x"
architecture: "x64"
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: build sdist(tarball) and bdist(wheel) to dist/
run: uv build
- name: publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,7 @@ venv.bak/
go

# vscode files
.vscode
.vscode

# setuptools_scm
_version.py
15 changes: 9 additions & 6 deletions monitoring/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,18 @@ RUN if [ "$(uname -m)" = "aarch64" ]; then \

RUN mkdir -p /app/

# This image should be built by passing in `version` and `commit_hash` based on information from git (see `make image`)
# This version information becomes available in the environment variables specified below
ARG version
ARG commit_hash
ENV MONITORING_VERSION=$version
ENV GIT_COMMIT_HASH=$commit_hash

# Install dependencies
ENV UV_LINK_MODE=copy
ENV UV_PROJECT_ENVIRONMENT=/venv/
ENV VIRTUAL_ENV=/venv/
ENV SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MONITORING=$version
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=./uv.lock,target=/app/uv.lock \
--mount=type=bind,source=./pyproject.toml,target=/app/pyproject.toml \
Expand All @@ -40,6 +48,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \

# Ensure UV don't check dependencies or lock file, since we installed everything before
ENV UV_FROZEN=1
ENV UV_NO_SYNC=1

# Ensure the cache folder is present and writable by anyone
# (Some command run with limited privileges)
Expand Down Expand Up @@ -70,12 +79,6 @@ ENV PYTHONPATH=/app
# Add venv to path
ENV PATH="/venv/bin/:$PATH"

# This image should be built by passing in `version` and `commit_hash` based on information from git (see `make image`)
# This version information becomes available in the environment variables specified below
ARG version
ARG commit_hash
ENV MONITORING_VERSION=$version
ENV GIT_COMMIT_HASH=$commit_hash

# No entry point maximizes flexibility in the use of this image
ENTRYPOINT []
Expand Down
35 changes: 33 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[project]
name = "monitoring"
version = "0.1.0"
dynamic = ["version"]
authors = [
{ name="InterUSS Platform", email="tsc@lists.interussplatform.org" },
]
description = "Monitoring framework to test UAS Service Suppliers"
readme = "README.md"
requires-python = "==3.13.11"
requires-python = ">=3.13"
dependencies = [
"aiohttp",
"arrow",
Expand Down Expand Up @@ -93,3 +96,31 @@ exclude = [
"monitoring/mock_uss/output/*",
"monitoring/uss_qualifier/output/*",
]

[build-system]
requires = [
"setuptools>=77.0.3",
"wheel", # for bdist package distribution
"setuptools_scm>=6.4", # for automated versioning
]

build-backend = "setuptools.build_meta"

[tool.setuptools]
include-package-data = true
package-dir = { "monitoring" = "monitoring" }

[tool.setuptools.packages.find]
where = ["."]
include = [
"monitoring.deployment_manager*",
"monitoring.mock_uss*",
"monitoring.monitorlib*",
"monitoring.prober*",
"monitoring.uss_qualifier*",
"monitoring._version.py"
]
namespaces = true

[tool.setuptools_scm]
write_to = "monitoring/_version.py"
Loading
Loading