Skip to content

Commit

Permalink
Release v2.4.0 (#131)
Browse files Browse the repository at this point in the history
* Update scheduling queries and unit tests to conform to Aerie v2.6 (#129)

* Updating scheduling module to work with Aerie 2.6

* Update to include a 2.6 banananation jar, and updated .env to use 2.6

* Refactor to replace deprecated datetime.utcnow() calls

* Removed banananation 2.2.0 jar

* Updated to use 2.6.0 instead of 2.2.0

* Updated aerie_client based on PR feedback

* Updating conftest to use v2.6.0

* Updated constraints queries to match v2.6.0 schema

* Updated aerie_host.is_auth_enabled()

* Updated constraints.py to remove unnecessary comments/add docstrings

* Removed upload_scheduling_goal wrapper function, as it is not being used and the same functionality is available with upload_scheduling_goals

* Documentation updates (#130)

* Updated pyproject.toml version to v2.4.0

---------

Co-authored-by: Carter Mak <[email protected]>
  • Loading branch information
joshhaug and cartermak authored Apr 11, 2024
1 parent db8046c commit 71ac983
Show file tree
Hide file tree
Showing 14 changed files with 282 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DOCKER_TAG=v2.2.0
DOCKER_TAG=v2.6.0
REPOSITORY_DOCKER_URL=ghcr.io/nasa-ammos

AERIE_USERNAME=aerie
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
strategy:
matrix:
python-version: ["3.6.15", "3.11"]
aerie-version: ["2.2.0"]
aerie-version: ["2.6.0"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
49 changes: 28 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,39 +343,40 @@ client = AerieClient(aerie_host)

### Contributor Installation

If you'd like to contribute to this project, you'll first need to clone this repository, and you will have to install [`poetry`](https://python-poetry.org/docs/master/).
The recommended develper installation method is in a [virutual environment](https://docs.python.org/3/library/venv.html) with an [editatable install via Pip](https://pip.pypa.io/en/latest/topics/local-project-installs/#editable-installs).

From the root of the repo, use `poetry` to install Aerie-CLI and its dependencies:
See this [primer](https://realpython.com/python-virtual-environments-a-primer/) or virtual environments to get set up. A quick and easy method is using Python's native `venv` package from the root of the Aerie-CLI repo:

```sh
poetry install
python3 -m venv venv
source venv/bin/activate
```

To run commands from source as you edit, use the `poetry run` command. For example:
Then, install Aerie-CLI in editable mode via Pip:

```
poetry run aerie-cli plans simulate --id 42
```sh
python3 -m pip install -e .
```

### Dependency Management
Now, your installation of Aerie-CLI will update as you make changes to the source code.

If you'd like to add or remove dependencies, you can use the `poetry add` and `poetry remove` commands, respectively. These will install the dependencies in your `poetry`-managed virtual environment, update your `pyproject.toml` file, and update your `poetry.lock` file. If you update the dependencies, you should stage and commit your changes to these two files so that others will be guaranteed to have the same Python configuration.
### Dependency Management

For more information on dependency and project management, see the [`poetry` docs](https://python-poetry.org/docs/master/).
Dependencies are currently managed via Poetry. For more information on dependency and project management, see the [`poetry` docs](https://python-poetry.org/docs/master/).

### Testing

Aerie-CLI has unit tests and integration tests built with the [pytest](https://docs.pytest.org/) library.

#### Unit Tests

Unit tests can be run anytime from `tests/unit_tests` and reference local test files. `test_aerie_client.py` is where unit tests are added to exercise particular methods of the `AerieClient` class using mocked Aerie API responses.
Unit tests can be run anytime and reference local test files. `test_aerie_client.py` is where unit tests are added to exercise particular methods of the `AerieClient` class using mocked Aerie API responses.

Run the unit tests using `pytest`:
Run the unit tests using `pytest` from the `tests/unit_tests` directory:

```
cd tests
poetry run pytest unit_tests
python3 -m pytest .
```

#### Integration Tests
Expand All @@ -384,18 +385,24 @@ A separate suite of tests is designed to validate CLI functionality against a lo

The integration tests are based on `Typer` testing documentation found [here](https://typer.tiangolo.com/tutorial/testing/).

### IDE Settings
### Releases

Since you are using `poetry` for development, your system Python interpreter will likely complain about any dependencies used within this project. To remedy this, you'll need to select the Python interpreter from your `poetry` virtualenv in your IDE. The method for doing so is unfortunately IDE-dependent, however.
Aerie-CLI generally follows the [gitflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) workflow model for managing releases:

#### VS Code
- Features are merged to the `develop` branch.
- Release branches are made from develop and merge in `main` for testing.
- Releases are made from the tip of the `main` branch.
- Hotfix branches can be made from `main` to resolve bugs without needing to incorporate new features.

For Mac users developing in VS Code, you can achieve this by adding the following setting to your `settings.json` file:
Version numbers are managed using [semantic versioning](https://semver.org) in [`pyproject.toml`](pyproject.toml):

```
"python.venvPath": "~/Library/Caches/pypoetry/virtualenvs",
```
- The version tag on `develop` is fixed at `0.0.0-dev0`
- Release versions are incremented on release branches before being merged to main.

After doing this, you can select a new Python interpreter by typing `Cmd + Shift + P` and selecting a Python interpreter which corresponds to your `poetry` virtualenv:
The full workflow for releasing a new version of Aerie-CLI:

<img width="601" alt="image" src="https://user-images.githubusercontent.com/7908658/201275707-00caca06-5e2b-4258-b5c4-f0548134af2f.png">
- Make a release branch from `develop`
- Merge `main` into the release branch
- Commit a version increment in `pyproject.toml`
- Open a PR to merge the release branch into `main` and verify CI passes
- Merge the PR and tag a release on `main`
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "aerie-cli"
version = "2.3.0"
version = "2.4.0"
description = "A CLI application and Python API for interacting with Aerie."
authors = []
license = "MIT"
Expand Down
Loading

0 comments on commit 71ac983

Please sign in to comment.