diff --git a/.github/workflows/.readthedocs.yml b/.github/workflows/.readthedocs.yml new file mode 100644 index 0000000..8bde111 --- /dev/null +++ b/.github/workflows/.readthedocs.yml @@ -0,0 +1,12 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.7" + +python: + install: + - requirements: requirements.txt +submodules: + include: all \ No newline at end of file diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..b6ae0e5 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,58 @@ +name: Python package + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + + +jobs: + ci: + name: "CI setup" + + strategy: + fail-fast: false + matrix: + python-version: + - "3.12" + - "3.11" + - "3.10" + + os: + - "ubuntu-latest" + + runs-on: "${{ matrix.os }}" + + # use bash everywhere + defaults: + run: + shell: "bash -l {0}" + + steps: + - name: "Checkout code" + uses: "actions/checkout@v4" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run pytest + run: pytest -v + + - name: Check style + run: yapf -d --recursive milliontrees/ --style=.style.yapf + + - name: Check notebook style + run: nbqa yapf --in-place docs/examples/*.ipynb --style=.style.yapf + + # - name: Check notebook build + # run: pytest --nbmake docs/*.ipynb + + - name: Run docformatter + run: docformatter --check --recursive milliontrees/ + + - name: Test Docs + run: | + cd docs && make clean && make html SPHINXOPTS="-W" \ No newline at end of file diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..b7a704b --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,39 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/README.md b/README.md index 1506866..de168b3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ +[![Github Actions](https://github.com/weecology/MillionTrees/actions/workflows/python-package.yml/badge.svg)](https://github.com/weecology/MillionTrees/actions/workflows/python-package.yml) +[![Documentation Status](https://readthedocs.org/projects/MillionTrees/badge/?version=latest)](http://MillionTrees.readthedocs.io/en/latest/?badge=latest) +[![Version](https://img.shields.io/pypi/v/MillionTrees.svg)](https://pypi.python.org/pypi/MillionTrees) +[![PyPI - Downloads](https://img.shields.io/pypi/dm/MillionTrees)](https://pypi.python.org/pypi/MillionTrees) -[![PyPI](https://img.shields.io/pypi/v/wilds)](https://pypi.org/project/wilds/) -[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/p-lambda/wilds/blob/master/LICENSE) # Overview diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b350e3b --- /dev/null +++ b/requirements.txt @@ -0,0 +1,13 @@ +numpy>=1.19.1 +ogb>=1.2.6 +outdated>=0.2.0 +pandas>=1.1.0 +pillow>=7.2.0 +pytz>=2020.4 +torch>=1.7.0 +torchvision>=0.8.2 +tqdm>=4.53.0 +scikit-learn>=0.20.0 +scipy>=1.5.4 +albumentations>=0.5.2 +pytest>=6.2.1 \ No newline at end of file