Skip to content

Commit

Permalink
feat(makefile): Introduce new targets for conda environment setup
Browse files Browse the repository at this point in the history
  • Loading branch information
esloch committed Dec 1, 2023
1 parent 1138803 commit 3c9d729
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ jobs:
use-mamba: true
miniforge-variant: Mambaforge

- name: Install dependencies
- name: Install main dependencies
run: |
curl -sSL https://install.python-poetry.org/ | python -
export PATH="$HOME/.poetry/bin:$PATH"
poetry config virtualenvs.create false
poetry build && poetry install --only main
poetry config virtualenvs.create false
make conda-install-main
- name: Lint with flake8
run: |
Expand Down
21 changes: 20 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,30 @@ SEMANTIC_RELEASE = npx --yes \
semantic-release


# Create a Conda environment and install dependencies for development.
.PHONY: conda-env
conda-env:
mamba env create -f conda/dev.yaml --force

# Install main project dependencies using Poetry.
.PHONY: conda-install-main
conda-install-main: conda-env
conda run -n pysus poetry install --only main

.PHONY: conda-install-docs
conda-install-docs:
conda run -n pysus poetry install --only docs

.PHONY: conda-install-geo
conda-install-geo:
conda run -n pysus pip install --no-use-pep517 shapely==1.8.5.post1
conda run -n pysus poetry install --only geo

# Linting
.PHONY: pre-commit-install
pre-commit-install:
poetry run pre-commit install

#* Linting
.PHONY: check-codestyle
check-codestyle: ## check style with flake8
# stop the build if there are Python syntax errors or undefined names
Expand Down
3 changes: 0 additions & 3 deletions conda/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ channels:
- conda-forge
- defaults
dependencies:
- setuptools
- python>=3.11
- numpy>=1.26.2
- cffi
- gcc
- make
- poetry>=1.3.2
- pip
- pip:
- shapely==1.8.5.post1 # Pinning Shapely version to resolve third-party dependency issues

0 comments on commit 3c9d729

Please sign in to comment.