-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
3,751 additions
and
5,656 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
$schema: "https://docs.renovatebot.com/renovate-schema.json", | ||
lockFileMaintenance: { | ||
enabled: true, | ||
}, | ||
} |
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 |
---|---|---|
|
@@ -10,7 +10,6 @@ on: | |
|
||
env: | ||
PYTHON_VERSION: "3.11" | ||
POETRY_VERSION: "1.8.2" | ||
|
||
jobs: | ||
documentation: | ||
|
@@ -21,16 +20,16 @@ jobs: | |
- run: | | ||
git fetch --prune --unshallow --tags | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
# Update full Python version | ||
- name: Full Python version | ||
run: | | ||
echo "PYTHON_VERSION=$(python -c "import platform; print(platform.python_version())")" | ||
- name: Download extra data from private repository | ||
uses: actions/checkout@v4 | ||
with: | ||
|
@@ -59,25 +58,6 @@ jobs: | |
unzip ENV_PostOPS_AIRAC_2111_04NOV2021_With_Airspace_Closure.zip -d airac_2111 | ||
shell: bash | ||
|
||
# virtualenv cache should depends on OS, Python version and `poetry.lock` (and optionally workflow files). | ||
- name: Cache Packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.local | ||
.venv | ||
key: poetry-${{ runner.os }}-${{ hashFiles('poetry.lock') }} | ||
|
||
- name: Install and configure Poetry | ||
uses: snok/[email protected] | ||
with: | ||
version: ${{ env.POETRY_VERSION }} | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Display Python version | ||
run: poetry run python -c "import sys; print(sys.version)" | ||
|
||
- name: Cache folder for traffic | ||
uses: actions/cache@v4 | ||
id: cache-folder | ||
|
@@ -86,15 +66,15 @@ jobs: | |
~/.cache/traffic/ | ||
~/.cache/opensky/ | ||
~/.cache/cartes/ | ||
key: traffic-${{ hashFiles('poetry.lock') }} | ||
key: traffic-${{ hashFiles('uv.lock') }} | ||
|
||
- name: Cache folder for documentation | ||
uses: actions/cache@v4 | ||
id: docs-folder | ||
with: | ||
path: | | ||
docs/_build/ | ||
key: docs-${{ hashFiles('poetry.lock') }} | ||
key: docs-${{ hashFiles('uv.lock') }} | ||
|
||
- name: Ubuntu system dependencies | ||
run: | | ||
|
@@ -107,18 +87,9 @@ jobs: | |
run: | | ||
npm install vega-lite vega-cli canvas # necessary dependency for altair-save | ||
- name: Dynamic versioning | ||
run: poetry self add "poetry-dynamic-versioning[plugin]" || true | ||
|
||
- name: Install dependencies | ||
- name: Install the project | ||
run: | | ||
poetry install -E full | ||
# This should not be necessary... but sometimes it is | ||
# https://traffic-viz.github.io/troubleshooting/installation.html | ||
# SHAPELY_VERSION=$(poetry run python -c "import shapely; print(shapely.__version__)") | ||
# poetry run pip uninstall -y shapely | ||
# poetry run pip install --no-binary shapely shapely==${SHAPELY_VERSION} | ||
uv sync --dev --all-extras | ||
- name: Build pages | ||
env: | ||
|
@@ -131,11 +102,11 @@ jobs: | |
TRAFFIC_CACHE_NO_EXPIRE: "" | ||
run: | | ||
# This downloads the cache for cartes atlas | ||
poetry run python -c "from cartes.atlas import default, world_atlas" | ||
uv run python -c "from cartes.atlas import default, world_atlas" | ||
# This downloads files to have in cache first | ||
poetry run traffic cache --fill | ||
uv run traffic cache --fill | ||
export TRAFFIC_CONFIG=$(poetry run python -c "from traffic import config_file; print(config_file)") | ||
export TRAFFIC_CONFIG=$(uv run python -c "from traffic import config_file; print(config_file)") | ||
sed -i "/tqdm_style =/ s,auto,silent," $TRAFFIC_CONFIG | ||
|
@@ -144,7 +115,7 @@ jobs: | |
# sed -i "/pkcs12_password =/ s,=$,= $PKCS12_PASSWORD," $TRAFFIC_CONFIG | ||
# Run the documentation | ||
cd docs && CARTES_CACHE=./cache poetry run make html | ||
cd docs && CARTES_CACHE=./cache uv run make html | ||
- name: Deploy pages | ||
uses: peaceiris/actions-gh-pages@v4 | ||
|
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 |
---|---|---|
|
@@ -3,37 +3,29 @@ name: publish | |
|
||
on: | ||
release: | ||
types: [published] | ||
types: | ||
- published | ||
workflow_dispatch: | ||
|
||
env: | ||
POETRY_VERSION: "1.8.2" | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install and configure Poetry | ||
uses: snok/[email protected] | ||
with: | ||
version: ${{ env.POETRY_VERSION }} | ||
virtualenvs-in-project: true | ||
|
||
- name: Display Python version | ||
run: poetry run python -c "import sys; print(sys.version)" | ||
|
||
- name: Dynamic versioning | ||
run: poetry self add "poetry-dynamic-versioning[plugin]" || true | ||
|
||
- name: Build packages | ||
run: poetry build | ||
run: | | ||
uvx --with hatch-vcs hatchling build | ||
- name: Publish a Python distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
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 |
---|---|---|
|
@@ -4,17 +4,50 @@ on: | |
push: | ||
branches: | ||
- master | ||
pull_request: | ||
pull_request_target: | ||
schedule: | ||
- cron: "42 7 * * 0" # Every Sunday morning when I am fast asleep :) | ||
# This is useful for keeping the cache fit and ready | ||
workflow_dispatch: | ||
|
||
env: | ||
POETRY_VERSION: "1.8.2" | ||
|
||
jobs: | ||
deploy: | ||
linting: | ||
name: linting/formatting | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
|
||
- name: Ubuntu system dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y libgdal-dev libgeos-dev libproj-dev proj-bin proj-data | ||
- name: Install the project | ||
run: | | ||
uv sync --dev --all-extras | ||
- name: Style checking | ||
run: | | ||
uv run ruff check src tests | ||
uv run ruff format --check src tests | ||
- name: Type checking | ||
run: uv run mypy src tests docs/usage/scripts | ||
|
||
tests: | ||
name: python-${{ matrix.python-version }} on ${{ matrix.os }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
@@ -41,17 +74,16 @@ jobs: | |
- run: | | ||
git fetch --prune --unshallow --tags | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# Update full Python version | ||
- name: Full Python version | ||
run: | | ||
echo "PYTHON_VERSION=$(python -c "import platform; print(platform.python_version())")" | ||
echo "PYTHON_VERSION=$(python -c "import platform; print(platform.python_version())")" >> $GITHUB_ENV | ||
- name: Download extra data from private repository | ||
uses: actions/checkout@v4 | ||
with: | ||
|
@@ -80,25 +112,6 @@ jobs: | |
unzip ENV_PostOPS_AIRAC_2111_04NOV2021_With_Airspace_Closure.zip -d airac_2111 | ||
shell: bash | ||
|
||
# virtualenv cache should depends on OS, Python version and `poetry.lock` (and optionally workflow files). | ||
- name: Cache Packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.local | ||
.venv | ||
key: poetry-${{ runner.os }}-${{ hashFiles('poetry.lock') }} | ||
|
||
- name: Install and configure Poetry | ||
uses: snok/[email protected] | ||
with: | ||
version: ${{ env.POETRY_VERSION }} | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Display Python version | ||
run: poetry run python -c "import sys; print(sys.version)" | ||
|
||
- name: Cache folder for traffic | ||
uses: actions/cache@v4 | ||
id: cache-folder | ||
|
@@ -107,28 +120,16 @@ jobs: | |
~/.cache/traffic/ | ||
~/.cache/opensky/ | ||
~/.cache/cartes/ | ||
key: traffic-${{ hashFiles('poetry.lock') }} | ||
key: traffic-${{ hashFiles('uv.lock') }} | ||
|
||
- name: Ubuntu system dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y libgdal-dev libgeos-dev libproj-dev proj-bin proj-data | ||
- name: Dynamic versioning | ||
run: poetry self add "poetry-dynamic-versioning[plugin]" || true | ||
|
||
- name: Install dependencies | ||
run: | | ||
poetry install -E full | ||
- name: Style checking | ||
run: | | ||
poetry run ruff check src tests | ||
poetry run ruff format --check src tests | ||
- name: Type checking | ||
- name: Install project | ||
run: | | ||
poetry run mypy src tests | ||
uv sync --dev --all-extras | ||
- name: Run tests | ||
if: ${{ matrix.python-version == '3.12' || steps.cache-folder.outputs.cache-hit == 'true' }} | ||
|
@@ -137,7 +138,6 @@ jobs: | |
TRAFFIC_NOPLUGIN: "" | ||
OPENSKY_USERNAME: ${{ secrets.OPENSKY_USERNAME }} | ||
OPENSKY_PASSWORD: ${{ secrets.OPENSKY_PASSWORD }} | ||
# PKCS12_PASSWORD: ${{ secrets.PKCS12_PASSWORD }} | ||
run: | | ||
export TRAFFIC_CONFIG=$(poetry run python -c "from traffic import config_file; print(config_file)") | ||
|
@@ -148,8 +148,8 @@ jobs: | |
# Don't purge OpenSky cache files here :) | ||
sed -i "/purge = / d" $TRAFFIC_CONFIG | ||
poetry run traffic cache --fill # download files to have in cache first | ||
poetry run pytest --cov --cov-report xml | ||
uv run traffic cache --fill # download files to have in cache first | ||
uv run pytest --cov --cov-report xml | ||
- name: Upload coverage to Codecov | ||
if: ${{ github.event_name != 'pull_request_target' }} | ||
|
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
Oops, something went wrong.