Skip to content
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

43 brake the link to maritime schema #44

Merged
merged 23 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
14b50eb
#Working on 43. Changed several files to break link to maritime schema.
tomarnepedersen Dec 20, 2024
e5e8f8a
Fixed missing conversion for own ship and target ship
tomarnepedersen Dec 20, 2024
1c2a277
Working on #43. Also updating project to support UV instead of poetry.
tomarnepedersen Jan 8, 2025
92a355f
Updating workflows
tomarnepedersen Jan 8, 2025
8045f40
Working on #43 and support for UV
tomarnepedersen Jan 16, 2025
c8fddd8
#43 fixing pyproject.toml file
tomarnepedersen Jan 16, 2025
94056d0
#43 Fixing mypy code quality stuff
tomarnepedersen Jan 16, 2025
3e61d53
#43 Updating documentation
tomarnepedersen Jan 16, 2025
482614a
#43 Updating documentation
tomarnepedersen Jan 16, 2025
3ea2a0a
#43 Documentation
tomarnepedersen Jan 16, 2025
7aa6f9f
#43 Working on documentation
tomarnepedersen Jan 16, 2025
29e13f3
#43 Fixed ruff error
tomarnepedersen Jan 16, 2025
69d451b
#43, updating python version
tomarnepedersen Jan 16, 2025
2e74372
#43 Updating the documentation in the code
tomarnepedersen Jan 17, 2025
d8babdd
#43 Updating documentation
tomarnepedersen Jan 17, 2025
3e35232
Removed the max speed output, updated the generated traffic situation…
tomarnepedersen Jan 17, 2025
42921bd
#43 adding file for documentation
tomarnepedersen Jan 19, 2025
05e399b
Cleaning up
tomarnepedersen Jan 19, 2025
28e2e17
#43 trying once more to include the input_files.rst
tomarnepedersen Jan 19, 2025
0bad08e
Updating gitignore file
tomarnepedersen Jan 19, 2025
b52e097
Making last changes to #43
tomarnepedersen Jan 20, 2025
02ab684
removing uv.lock
tomarnepedersen Jan 20, 2025
c4e6d76
Updating version number
tomarnepedersen Jan 20, 2025
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
13 changes: 13 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[paths]
source =
src/trafficgen
*/site-packages/trafficgen

[run]
source = trafficgen
branch = True

[report]
fail_under = 10.0
show_missing = True
skip_covered = True
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ root = true
[*]
indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
Expand Down
27 changes: 12 additions & 15 deletions .github/workflows/_build_and_publish_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ jobs:
- name: Checkout active branch
uses: actions/checkout@v4
with:
fetch-depth: 1
lfs: true
- name: Install Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
python-version: '3.11'
cache: 'pip' # cache pip dependencies
- uses: actions/download-artifact@v4
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
name: requirements-files
- name: Install dependencies
run: |
pip install -r requirements-docs.txt
python-version-file: "pyproject.toml"
- name: Install the project
run: uv sync --upgrade
- name: Print debugging information
run: |
echo "github.ref:" ${{github.ref}}
Expand All @@ -39,17 +38,15 @@ jobs:
git branch
git branch -a
git remote -v
python -V
pip list --not-required
pip list
uv run python -V
uv pip list

# Build documentation
- uses: sphinx-doc/github-problem-matcher@master
- name: Build documentation
run: |
cd docs
sphinx-apidoc -f -e -M -o . ../src/trafficgen
make html
uv run make html

- name: Clone and cleanup gh-pages branch
run: |
Expand Down
49 changes: 12 additions & 37 deletions .github/workflows/_build_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,21 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
lfs: true
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip' # cache pip dependencies
- name: Install build and twine
run: pip install build twine
- name: Run build
run: python -m build
python-version-file: "pyproject.toml"
- name: Build source distribution and wheel
run: uv build
- name: Run twine check
run: twine check --strict dist/*
run: uvx twine check --strict dist/*
- uses: actions/upload-artifact@v4
with:
path: ./dist/*.tar.gz

# build_wheels:
# name: Build wheels for ${{ matrix.platform }}
# needs:
# - black
# - ruff
# - pyright
# - test
# runs-on: ${{ matrix.platform }}
# strategy:
# matrix:
# platform: [ubuntu-latest, macos-latest, windows-latest]
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 1
# lfs: true
# - uses: actions/setup-python@v5
# with:
# python-version: '3.11'
# cache: 'pip' # cache pip dependencies
# - name: Install cibuildwheel
# run: python -m pip install cibuildwheel==2.16
# - name: Build wheels
# run: python -m cibuildwheel --output-dir wheels
# - uses: actions/upload-artifact@v4
# with:
# path: ./wheels/*.whl
path: |
dist/*.tar.gz
dist/*.whl
97 changes: 60 additions & 37 deletions .github/workflows/_code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,78 @@ name: Code Quality
on: workflow_call

jobs:
black:
name: black
ruff_format:
runs-on: ubuntu-latest
name: ruff format
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
options: '--check --diff'
src: '.'
jupyter: true
version: '==23.12'
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install the project
run: uv sync --upgrade
- name: Run ruff format
run: uv run ruff format --diff

ruff:
ruff_check:
runs-on: ubuntu-latest
name: ruff
name: ruff check
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip' # cache pip dependencies
- uses: actions/download-artifact@v4
with:
name: requirements-files
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Install ruff
run: pip install ruff==0.1.8
- name: Run ruff
run: ruff .
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install the project
run: uv sync --upgrade
- name: Run ruff check
run: uv run ruff check --diff

pyright:
runs-on: ubuntu-latest
name: pyright
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip' # cache pip dependencies
- uses: actions/download-artifact@v4
with:
name: requirements-files
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install pytest
- name: Install pyright
run: pip install pyright==1.1.338
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install the project
run: uv sync --upgrade
- name: Run pyright
run: pyright .
run: uv run pyright

mypy:
runs-on: ubuntu-latest
name: mypy
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install the project
run: uv sync --upgrade
- name: Run mypy
run: uv run mypy
8 changes: 7 additions & 1 deletion .github/workflows/_merge_into_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ jobs:
with:
type: now
target_branch: release
github_token: ${{ secrets.RELEASE_TOKEN }}
# @TODO: A dedicated RELEASE_TOKEN should be created in the repo settings
# and used for this task when in production.
# It is set here to the default GITHUB_TOKEN only
# for demonstration purposes, enabling the workflow in the repo template
# to run without additional configuration.
# github_token: ${{ secrets.RELEASE_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
34 changes: 0 additions & 34 deletions .github/workflows/_requirements_files.yml

This file was deleted.

25 changes: 12 additions & 13 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,31 @@ on: workflow_call

jobs:
test:
name: Test on ${{matrix.python.toxenv}}-${{matrix.platform.toxenv}}
name: Test on ${{matrix.python.version}}-${{matrix.platform.runner}}
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
toxenv: linux
- runner: windows-latest
toxenv: windows
# - runner: macos-latest
python:
- version: '3.9'
toxenv: 'py39'
- version: '3.10'
toxenv: 'py310'
- version: '3.11'
toxenv: 'py311'
- version: '3.12'
toxenv: 'py312'
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install Python ${{ matrix.python.version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python.version }}
cache: 'pip' # cache pip dependencies
- name: Install tox
run: python -m pip install tox
- name: Install the project
run: uv sync -p ${{ matrix.python.version }} -U --no-dev
- name: Run pytest
run: tox -e ${{matrix.python.toxenv}}-${{matrix.platform.toxenv}}
run: >
uv run --with pytest --with pytest-cov
pytest --cov
28 changes: 16 additions & 12 deletions .github/workflows/_test_future.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
name: Unit Tests (py312)
# Test also with Python 3.12 (experimental; workflow will not fail on error.)
name: Unit Tests (py313)
# Test also with Python 3.13 (experimental; workflow will not fail on error.)

on: workflow_call

jobs:
test312:
name: Test on ${{matrix.python.toxenv}}-${{matrix.platform.toxenv}} (experimental)
test313:
name: Test on ${{matrix.python.version}}-${{matrix.platform.runner}} (experimental)
continue-on-error: true
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
toxenv: linux
- runner: windows-latest
toxenv: windows
python:
- version: '3.13.0a2'
toxenv: 'py313'
- version: '3.13.0-alpha - 3.13.0'
uvpy: '3.13'
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install Python ${{ matrix.python.version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python.version }}
cache: 'pip' # cache pip dependencies
- name: Install tox
run: python -m pip install tox
- name: Install the project
run: uv sync -p ${{ matrix.python.uvpy }} -U --no-dev
- name: Run pytest
run: tox -e ${{matrix.python.toxenv}}-${{matrix.platform.toxenv}}
run: >
uv run --with pytest --with pytest-cov
pytest --cov
Loading
Loading