Skip to content

Commit

Permalink
adjust documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
xoolive committed Nov 5, 2024
1 parent b099a83 commit c530cb7
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "traffic development environment",
"image": "ghcr.io/xoolive/traffic/poetry:latest",
"image": "ghcr.io/xoolive/traffic/uv:latest",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -12,5 +12,5 @@
]
}
},
"postCreateCommand": "poetry install && poetry shell"
"postCreateCommand": "uv sync --dev --all-extras"
}
22 changes: 11 additions & 11 deletions .github/workflows/run-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag'
required: true
description: "Release tag"
required: true
type: string

env:
TRAFFIC_JUPYTER_URL: ghcr.io/xoolive/traffic/jupyter
TRAFFIC_POETRY_URL: ghcr.io/xoolive/traffic/poetry
TRAFFIC_UV_URL: ghcr.io/xoolive/traffic/uv

jobs:
build:
Expand Down Expand Up @@ -38,14 +38,14 @@ jobs:
docker push ${{ env.TRAFFIC_JUPYTER_URL }}:${{ inputs.tag }}
docker push ${{ env.TRAFFIC_JUPYTER_URL }}:latest
# poetry Docker image
- name: Build poetry docker image
run: docker build --file docker/poetry.Dockerfile --tag ${{ env.TRAFFIC_POETRY_URL }}:${{ inputs.tag }} --tag ${{ env.TRAFFIC_POETRY_URL }}:latest .
# uv Docker image
- name: Build uv docker image
run: docker build --file docker/uv.Dockerfile --tag ${{ env.TRAFFIC_UV_URL }}:${{ inputs.tag }} --tag ${{ env.TRAFFIC_UV_URL }}:latest .

- name: Test poetry docker image
run: docker run ${{ env.TRAFFIC_POETRY_URL }}:latest /bin/bash -c "pip install traffic; python -c \"import traffic; print(traffic.__version__)\""
- name: Test uv docker image
run: docker run ${{ env.TRAFFIC_UV_URL }}:latest /bin/bash -c "pip install traffic; python -c \"import traffic; print(traffic.__version__)\""

- name: Push poetry image
- name: Push uv image
run: |
docker push ${{ env.TRAFFIC_POETRY_URL }}:${{ inputs.tag }}
docker push ${{ env.TRAFFIC_POETRY_URL }}:latest
docker push ${{ env.TRAFFIC_UV_URL }}:${{ inputs.tag }}
docker push ${{ env.TRAFFIC_UV_URL }}:latest
5 changes: 2 additions & 3 deletions docker/poetry.Dockerfile → docker/uv.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ RUN useradd -ms /bin/bash user
USER user
WORKDIR /home/user/

# Install poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="${PATH}:/home/user/.local/bin"
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
13 changes: 3 additions & 10 deletions docs/data_sources/flightplans.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
How to access flight plan information?
======================================

A :class:`~traffic.core.flightplan.FlightPlan` is a structure designed to parse
flight plans in the ICAO format. Access to such field may be complicated for non
operational fellows, who may have access to different sources of data.
A :class:`~traffic.core.flightplan.FlightPlan` is a structure designed to parse flight plans in the ICAO format. Access to such field may be complicated for non-operational fellows, who may have access to different sources of data.

EUROCONTROL B2B web services
----------------------------

The `NM B2B web services
<https://www.eurocontrol.int/service/network-manager-business-business-b2b-web-services>`_
is an interface provided by the EUROCONTROL Network Manager (NM) for
system-to-system access to its services and data, allowing users to
retrieve and use the information in their own systems.
The `NM B2B web services <https://www.eurocontrol.int/service/network-manager-business-business-b2b-web-services>`_ is an interface provided by the EUROCONTROL Network Manager (NM) for system-to-system access to its services and data, allowing users to retrieve and use the information in their own systems.

.. danger::

This code has been moved out of the traffic library. You may install
`pyb2b <https://github.com/xoolive/pyb2b>` for the same functionalities.
This code has been moved out of the traffic library. You may install `pyb2b <https://github.com/xoolive/pyb2b>` for the same functionalities.
23 changes: 8 additions & 15 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,27 @@ the same exact versions of all dependency libraries.
The following steps **are not mandatory**, but they will ensure a swift
reviewing process:

- install `poetry <https://python-poetry.org/>`_ on your workstation
- install traffic with poetry:
- install `uv <https://docs.astral.sh/uv/>`_ on your workstation
- install traffic with uv:

.. code:: bash
git clone --depth 1 https://github.com/xoolive/traffic
cd traffic/
poetry install -E all
uv sync --dev --all-extras # or just select the extra you need
Then, you may:

- prefix all your commands with ``poetry run``
- or run a shell with all environment variables properly set with ``poetry
shell``
- prefix all your commands with ``uv run``
- or activate the environment located in ``.venv``

- install the `pre-commit <https://pre-commit.com/>`_ hooks so a minimum set of
sanity checks can be performed and so you can fix issues before continuous
integration (GitHub Actions) fails.

.. code:: bash
poetry run pre-commit install
uv run pre-commit install
If you work with Visual Studio Code, you can use the Development container that
already contains all the dependencies. Just pull/clone the latest version and
Expand All @@ -110,16 +109,10 @@ Just click *Reopen in Container* and VS Code will create and configure the
container for you. You can now work in the container with a pre-defined
development environment that contains all the dependencies you need.

The provided image runs with `poetry <https://python-poetry.org/>`__ which will
The provided image runs with `uv <https://docs.astral.sh/uv/>`__ which will
set a proper environment with frozen version of dependencies, a desirable
behaviour when you run tests in continuous integration.

If your sit behind a proxy, the ``poetry install`` command which will run
automatically when you first open the Docker container may fail: you may have
to manually set your proxy environment variables in the container shell before
running ``poetry install`` again in order to get the container ready.

.. hint::

Read more about :ref:`Docker containers <How to use traffic in a Docker
container?>` for traffic.
Read more about :ref:`Docker containers <How to use traffic in a Docker container?>` for traffic.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ Static visualization (images) exports are accessible via Matplotlib/Cartopy. Mor
- If you are not familiar/comfortable with your Python environment, please install the latest `traffic` release in a new, fresh conda environment.

```sh
conda create -n traffic -c conda-forge python=3.10 traffic
conda create -n traffic -c conda-forge python=3.12 traffic
```

- Adjust the Python version you need (>=3.9) and append packages you need for working efficiently, such as Jupyter Lab, xarray, PyTorch or more.
- Adjust the Python version you need (>=3.10) and append packages you need for working efficiently, such as Jupyter Lab, xarray, PyTorch or more.
- Then activate the environment every time you need to use the `traffic` library:

```sh
Expand Down

0 comments on commit c530cb7

Please sign in to comment.