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

setup.py -> pyproject.toml #3

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

Expand All @@ -24,7 +24,6 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
Expand All @@ -41,7 +40,7 @@ jobs:
shell: /bin/zsh {0}
run: |
conda env create --file environment.yaml
conda run -n ${{ env.PACKAGE }} --no-capture-output pip install .
conda run -n ${{ env.PACKAGE }} --no-capture-output poetry install
if: matrix.os == 'macos-latest'

- name: Run pytest
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ __pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
Expand Down
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

34 changes: 21 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

.DEFAULT: help
help:
@echo "make init"
@echo " initialize dev environment."
@echo "make create"
@echo " create env and install dependencies."
@echo "make update"
Expand All @@ -17,7 +15,7 @@ help:

ENV=xleaf
PYTHON_VERSION=3.9
ENV_CONDA=conda run -n ${ENV} --no-capture-output
CONDA_ENV=conda run -n ${ENV} --no-capture-output

UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
Expand All @@ -27,25 +25,35 @@ ifeq ($(UNAME_S),Darwin)
CONDA_LOCK=conda-osx-arm64.lock
endif

init:
conda-lock --mamba -f environment.yaml -k explicit

create:
conda create -n ${ENV} --file ${CONDA_LOCK}
${ENV_CONDA} pip install -e .
${ENV_CONDA} pre-commit install
${CONDA_ENV} poetry install
${CONDA_ENV} pre-commit install

update:
conda-lock --mamba -f environment.yaml -k explicit
${ENV_CONDA} conda update --file ${CONDA_LOCK}
${CONDA_ENV} conda update --file ${CONDA_LOCK}

test:
${ENV_CONDA} pytest -n auto
${CONDA_ENV} pytest -n auto

deploy:
rm -rf dist/
${CONDA_ENV} python3 setup.py sdist bdist_wheel
${CONDA_ENV} twine upload dist/*

destroy:
conda env remove -n ${ENV}

deploy:
# dev utilities
init:
conda-lock --mamba -f environment.yaml -k explicit

fortran:
f2py -c -m prosail prosail/MODULE_PRO4SAIL.f90 prosail/dataSpec_PDB.f90 prosail/main_PROSAIL.f90 prosail/LIDF.f90 prosail/dladgen.f prosail/PRO4SAIL.f90 prosail/prospect_DB.f90 prosail/tav_abs.f90 prosail/volscatt.f90 \
&& mv *.so xleaf/

pypi:
rm -rf dist/
${ENV_CONDA} python3 setup.py sdist bdist_wheel
${ENV_CONDA} twine upload dist/*
${CONDA_ENV} poetry build
twine upload dist/*
272 changes: 83 additions & 189 deletions conda-linux-64.lock

Large diffs are not rendered by default.

214 changes: 91 additions & 123 deletions conda-osx-arm64.lock

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,10 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.9.*
- python=3.10
- pip
- numpy
- poetry
- gfortran
- pre-commit
- pytest
- pytest-xdist
- wheel
- ipython
- matplotlib
platforms:
- linux-64
- osx-arm64
3,250 changes: 3,250 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[tool.poetry]
name = "xleaf"
version = "1.0.1"
description = "Leaf and canopy radiative transfer modeling tools built on PROSPECT-D and SAIL"
authors = ["Christopher Anderson <cbanders@alumni.stanford.edu>"]
license = "MIT"
readme = "README.md"
include = ["xleaf/*.so"]
keywords = ["prosail", "prospect", "radiative transfer modeling", "simulation modeling", "remote sensing"]

[tool.poetry.dependencies]
python = "^3.9"
numpy = ">=1.21.5"

[tool.poetry.group.dev.dependencies]
ipython = "^8.18.1"
jupyter = "^1.0.0"
pre-commit = "^3.6.0"
pytest = "^7.4.3"
pytest-cov = "^4.1.0"
pytest-xdist = "^3.5.0"
twine = "^4.0.2"
mkdocs-material = "^9.5.2"
mkdocs-jupyter = "^0.24.6"
livereload = "^2.6.3"
mkdocstrings = "^0.24.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

53 changes: 0 additions & 53 deletions setup.py

This file was deleted.

Binary file added xleaf/prosail.cpython-310-x86_64-linux-gnu.so
Binary file not shown.
Binary file added xleaf/prosail.cpython-311-x86_64-linux-gnu.so
Binary file not shown.
Binary file added xleaf/prosail.cpython-39-x86_64-linux-gnu.so
Binary file not shown.
Loading