Skip to content

Commit

Permalink
Merge pull request #32 from sco1/align-v1
Browse files Browse the repository at this point in the history
Release v0.7.0
  • Loading branch information
sco1 authored Sep 9, 2024
2 parents abb279f + 40ecf6e commit f2643f2
Show file tree
Hide file tree
Showing 23 changed files with 1,790 additions and 1,932 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.6.0
current_version = 0.7.0
commit = False
allow_dirty = True

Expand Down
78 changes: 55 additions & 23 deletions .github/workflows/lint_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,75 +12,107 @@ jobs:
lint:
runs-on: ubuntu-latest

env:
UV_CACHE_DIR: /tmp/.uv-cache

steps:
- uses: actions/checkout@v4
- name: Install Poetry for caching
run: pipx install poetry

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.3.5/install.sh | sh

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'poetry'
python-version-file: "pyproject.toml"

- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install dependencies
run: |
python -m pip install -U pip setuptools importlib-metadata
pip install poetry
poetry install
run: uv sync --all-extras --dev

- name: Run mypy
run: poetry run mypy .
run: uv run mypy .
if: always()

- name: Minimize uv cache
run: uv cache prune --ci

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13-dev"]
fail-fast: false

env:
UV_CACHE_DIR: /tmp/.uv-cache

steps:
- uses: actions/checkout@v4
- name: Install Poetry for caching
run: pipx install poetry

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.3.5/install.sh | sh

- name: Set up (release) Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
if: "!endsWith(matrix.python-version, '-dev')"
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- name: Set up (deadsnakes) Python ${{ matrix.python-version }}
uses: deadsnakes/action@v3.1.0
uses: deadsnakes/action@v3.2.0
if: endsWith(matrix.python-version, '-dev')
with:
python-version: ${{ matrix.python-version }}
tk: true

- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install dependencies
run: |
python -m pip install -U pip setuptools importlib-metadata
pip install tox-gh-actions
uv venv
uv pip install tox-gh-actions tox-uv
- name: Run tests w/tox
run: tox
run: uv run tox

- name: Cache coverage for ${{ matrix.python-version }}
uses: actions/upload-artifact@v4
with:
name: cov_py${{ matrix.python-version }}
path: .coverage
if-no-files-found: error
include-hidden-files: true

- name: Minimize uv cache
run: uv cache prune --ci

combine-cov:
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version-file: "pyproject.toml"

- name: Pull coverage workflow artifacts
uses: actions/download-artifact@v4
Expand All @@ -89,17 +121,17 @@ jobs:

- name: Install cov & combine
run: |
pip install coverage
python -m pip install coverage
coverage combine ./cov_cache/**/.coverage
- name: Report coverage
run: |
echo '**Combined Coverage**' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
coverage report -m --skip-covered >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
coverage html
# Report a markdown version to the action summary
echo '**Combined Coverage**' >> $GITHUB_STEP_SUMMARY
coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
- name: Publish cov HTML
uses: actions/upload-artifact@v4
with:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.3.5/install.sh | sh

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version-file: "pyproject.toml"

- name: Install build dependencies & build
run: |
python -m pip install --upgrade pip
pip install poetry
poetry build
- name: Build package
run: uvx --from build pyproject-build --installer uv

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.9
Expand Down
30 changes: 21 additions & 9 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,53 @@ concurrency:
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest

env:
UV_CACHE_DIR: /tmp/.uv-cache

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.3.5/install.sh | sh

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version-file: "pyproject.toml"

- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install dependencies
run: |
python -m pip install -U pip setuptools importlib-metadata
pip install poetry
poetry install
run: uv sync --all-extras --dev

- name: Build static site
run: |
poetry run mkdocs build
run: uv run mkdocs build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './site'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

- name: Minimize uv cache
run: uv cache prune --ci
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ repos:
- id: python-check-blanket-type-ignore
- id: python-use-type-annotations
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.2
rev: v0.6.4
hooks:
- id: ruff
4 changes: 4 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ ignore = [
"D101",
"D103",
]
"tests/conftest.py" = [
"D101",
"D103",
]
"pyflysight/config_params.py" = [
"D101",
]
Expand Down
24 changes: 18 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Changelog
Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (`<major>`.`<minor>`.`<patch>`)

## [0.7.0]
### Added
* #15 Add `pyflysight.flysight_proc.FlysightV1` and `pyflysight.flysight_proc.FlysightV1FlightLog` container classes for interfacing with FlySight V1 track data & metadata
* #30 Add optional normalization of GPS coordinates in plaintext log files
* #34 Add CLI pipeline for parsing FlySight V2 flight logs into more user-friendly CSV files.

### Changed
* (Internal) #21 Utilize MkDocs for documentation generation
* #15 FlySight V1 related parsing helpers now utilize `pyflysight.flysight_proc.FlysightV1FlightLog` instances rather than bare `DataFrame`s
* (Internal) Migrate to uv from poetry

## [0.6.0]
### Added
* #24 Add optional normalization of parsed GPS coordinates
Expand All @@ -23,10 +34,11 @@ Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (`<ma

### Added
* Add additional helpers to `pyflysight.config_utils` and `pyflysight.flysight_utils`
* (Internal) #21 Add documentation autogeneration using `pdoc3`

## [v0.4.0]
### Added
* Add derived `total_accel` column to Flysight V2 IMU sensor dataframe, calculated as a vector sum of the `xyz` acceleration components
* Add derived `total_accel` column to FlySight V2 IMU sensor dataframe, calculated as a vector sum of the `xyz` acceleration components
* Add `pyflysight.log_utils.locate_log_subdir` helper for resolving child log directory from a given top-level directory
* Add `pyflysight.log_utils.iter_log_dirs` helper for iterating through child log directories of a given top-level directory
* #19 Add `pyflysight.config_utils` for config file generation
Expand All @@ -37,14 +49,14 @@ Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (`<ma
* (Internal) Bump to Polars v1.x

### Added
* #18 Add `pyflysight.log_utils.classify_log_dir` helper for classifying the Flysight hardware rev of a given log directory
* #18 Add `pyflysight.log_utils.classify_log_dir` helper for classifying the FlySight hardware rev of a given log directory

## [v0.2.0]
### Added
* Add parsing pipelines for Flysight V1 track data files
* #8 Add parsing pipelines for Flysight V2 track & sensor data files
* #11 Add trimming for Flysight V1 & V2 data files
* #12 Add simplified CSV log export for Flysight V2 data files
* Add parsing pipelines for FlySight V1 track data files
* #8 Add parsing pipelines for FlySight V2 track & sensor data files
* #11 Add trimming for FlySight V1 & V2 data files
* #12 Add simplified CSV log export for FlySight V2 data files

## [v0.1.0]
Initial release - yay!
11 changes: 7 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Contributing
## Development Environment
This project uses [Poetry](https://python-poetry.org/) to manage dependencies. With your fork cloned to your local machine, you can install the project and its dependencies to create a development environment using:
Development of this project is done using the supported Python version most recently released. Note that tests are run against all supported versions of Python; see: [Testing & Coverage](#testing-and-coverage) for additional information.

This project uses [uv](https://docs.astral.sh/uv) to manage dependencies. With your fork cloned to your local machine, you can install the project and its dependencies to create a development environment using:

```bash
$ poetry install
$ uv venv
$ uv sync --all-extras --dev
```

A [`pre-commit`](https://pre-commit.com) configuration is also provided to create a pre-commit hook so linting errors aren't committed:
Expand All @@ -20,8 +23,8 @@ $ mypy .

Note that `mypy` is not included as a pre-commit hook.

## Testing & Coverage
A [pytest](https://docs.pytest.org/en/latest/) suite is provided, with coverage reporting from [`pytest-cov`](https://github.com/pytest-dev/pytest-cov). A [`tox`](https://github.com/tox-dev/tox/) configuration is provided to test across all supported versions of Python. Testing will be skipped for Python versions that cannot be found.
## Testing and Coverage
A [pytest](https://docs.pytest.org/en/latest/) suite is provided, with coverage reporting from [`pytest-cov`](https://github.com/pytest-dev/pytest-cov). A [`tox`](https://github.com/tox-dev/tox/) configuration is provided to test across all supported versions of Python. Testing will be skipped locally for Python versions that cannot be found; all supported versions are tested in CI.

```bash
$ tox
Expand Down
Loading

0 comments on commit f2643f2

Please sign in to comment.