diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2eaed6e..72e3b53 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,37 +1,41 @@ -name: Publish Python Package +name: Build and Test Python Package on: push: - tags: - - 'v*.*.*' + branches: + - main + pull_request: + branches: + - main jobs: - release: + test: runs-on: ubuntu-latest steps: - name: Check out the repository uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 + - name: Install Miniconda + uses: conda-incubator/setup-miniconda@v3 with: - python-version: '3.x' + auto-update-conda: true + python-version: "3.10" + channels: conda-forge - - name: Install build dependencies + - name: Create Conda environment with Python 3.10 and PDAL run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine + conda create --name pyforestscan_env python=3.10 pdal gdal -c conda-forge -v - - name: Run tests + - name: Activate Conda environment and install dependencies + shell: bash -l {0} run: | + conda activate pyforestscan_env pip install -r requirements.txt pip install -r requirements-dev.txt - pytest - - name: Publish to PyPI - env: - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + - name: Run tests + shell: bash -l {0} run: | - python setup.py sdist bdist_wheel - twine upload dist/* -u __token__ -p $PYPI_TOKEN \ No newline at end of file + conda activate pyforestscan_env + pytest \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..14d2ebd --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish Python Package + +on: + push: + tags: + - 'v*.*.*' + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Check out the repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + + - name: Publish to PyPI + env: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* -u __token__ -p $PYPI_TOKEN \ No newline at end of file diff --git a/README.md b/README.md index 339aa28..f418a07 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ pip install pyforestscan > You MUST have installed PDAL to use PyForestScan. If you use conda to install PDAL, make sure you install pyforestscan in the conda environment with PDAL. See https://pdal.io/en/latest/ for more information. - PDAL >= 2.7 -- Python >= 3.8 +- Python >= 3.10 ## Quick Start diff --git a/setup.py b/setup.py index d6b45eb..bbdd6e1 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ "Operating System :: OS Independent", ], packages=setuptools.find_packages(), - python_requires=">=3.8", + python_requires=">=3.10", install_requires=[ 'rasterio>=1.3.11', 'pdal>=3.4.5', diff --git a/test_data/output.tif b/test_data/output.tif deleted file mode 100644 index ed14ca1..0000000 Binary files a/test_data/output.tif and /dev/null differ