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

Use Pixi to manage reproducible environment #207

Merged
merged 9 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
50 changes: 13 additions & 37 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Continuous Integration

on:
push:
branches: [main]
Expand All @@ -17,15 +17,12 @@

jobs:
tests:
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest]
environment-file: [
ci/py311_simplification-latest.yaml,
]
os: [ubuntu-latest, macos-latest, macos-14, windows-latest]
fail-fast: false

defaults:
Expand All @@ -37,41 +34,20 @@
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ matrix.environment-file }}
micromamba-version: "latest"

# - must be editable install for current tests to pass
# - due to data & pathing; probably need to:
# 1. rethink current 'convenience' funcs;
# 2. move `data/` into `core/data/`
# 3. something else
- name: install package
run: "pip install -e .[tests]"
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
cache: true
environments: "tests"

- name: environment info
run: "micromamba info && micromamba list"

- name: spatial versions
run: 'python -c "import geopandas; geopandas.show_versions();"'
run: 'pixi run -e tests python -c "import geopandas; geopandas.show_versions();"'

- name: run tests
run: |
pytest \
core/ \
--verbose \
-r a \
--numprocesses logical \
--color yes \
--cov core \
--cov-append \
--cov-report term-missing \
--cov-report xml . \
--env_type ${{ matrix.environment-file }}
run:
pixi run -e tests pytest -v -r a -n logical --color yes --cov code --cov-append --cov-report term-missing --cov-report xml .

- name: codecov
uses: codecov/codecov-action@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,7 @@ cython_debug/
# Other stuff
.DS_Store
data/*/temp-parenx/*
*.qgz
*.qgz
# pixi environments
.pixi
*.egg-info
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,30 @@ Demonstration visualizations on specific types of urban form.
* `roandabout.mp4`
* `points.json` - use case locations

### `environment.yml`
### Reproducible environment

Install and activate the `conda` (or mamba) environment, which creates an environment name `simplification`:
This project uses reproducible multi-platform environments using [Pixi](https://pixi.sh). To create an environment able to run all the code in the repository, clone the repository and install the locked environment using:

```sh
pixi install
```
conda env create -f environment.yml
conda activate simplification

#### Development

To install the development environment allowing testing:

```sh
pixi install -e tests
```

If you would like to run the tests, use the `tests` Pixi environment:

```sh
pixi run -e tests pytest
```

Installing pre-commit hook to the env:

```sh
pixi run pre-commit install
```
41 changes: 0 additions & 41 deletions ci/py311_simplification-latest.yaml

This file was deleted.

41 changes: 0 additions & 41 deletions environment.yml

This file was deleted.

Loading
Loading