diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a2092cb..a3df8f2 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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: | diff --git a/Makefile b/Makefile index a9d23f9..ef4c15c 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/conda/dev.yaml b/conda/dev.yaml index 3893844..98b8c5a 100644 --- a/conda/dev.yaml +++ b/conda/dev.yaml @@ -3,7 +3,6 @@ channels: - conda-forge - defaults dependencies: - - setuptools - python>=3.11 - numpy>=1.26.2 - cffi @@ -11,5 +10,3 @@ dependencies: - make - poetry>=1.3.2 - pip - - pip: - - shapely==1.8.5.post1 # Pinning Shapely version to resolve third-party dependency issues \ No newline at end of file