Skip to content

Commit

Permalink
Update repo URL and GitHub Actions (#47)
Browse files Browse the repository at this point in the history
* Update repo URL

* Add CI for Python 3.11

* Add MacOS

* Update GitHub Actions

* Update GitHub Actions

* Add Python 3.12

* Add whitebox

* Add whitebox

* Fix macos build

* Fix macos build

* Fix macos build

* Install gdal

* Fix gdal error

* Fix gdal installation error

* Skip import

* Skip Python 3.8 test
  • Loading branch information
giswqs authored Mar 4, 2024
1 parent 0c74151 commit ab29205
Show file tree
Hide file tree
Showing 16 changed files with 959 additions and 869 deletions.
67 changes: 0 additions & 67 deletions .github/workflows/build.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.12"
- name: Install dependencies
run: |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable -y
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
on:
push:
branches:
- master
pull_request:
branches:
- master

name: macOS build
jobs:
test-macOS:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.py }})
strategy:
fail-fast: false
matrix:
config:
- { os: macOS-latest, py: "3.12" }
env:
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
python-version: ${{ matrix.config.py }}
channels: conda-forge,defaults
channel-priority: true
miniconda-version: latest

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Testing conda
run: |
conda info
conda list
- name: Install GDAL
run: |
conda install -c conda-forge mamba --yes
mamba install -c conda-forge gdal pyproj richdem lidar --yes
# pip install -U whitebox

# - name: Test GDAL installation
# run: |
# python -c "from osgeo import gdal"
# gdalinfo --version

# - name: Install dependencies
# run: |
# pip install -r requirements.txt -r requirements_dev.txt
# pip install .

# - name: Test import
# run: python -c "import lidar; print('lidar import successful')"
66 changes: 66 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on:
push:
branches:
- master
pull_request:
branches:
- master

name: Linux build
jobs:
test-ubuntu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

defaults:
run:
shell: bash -el {0}

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
python-version: ${{ matrix.python-version }}
channels: conda-forge,defaults
channel-priority: true
miniconda-version: latest

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Testing conda
run: |
conda info
conda list
- name: Install GDAL
run: |
# pip install --no-cache-dir Cython
# pip install --find-links=https://girder.github.io/large_image_wheels --no-cache GDAL
conda install gdal --yes
conda install -c conda-forge mamba --yes
mamba install -c conda-forge pyproj richdem lidar --yes
# - name: Test GDAL installation
# run: |
# python -c "from osgeo import gdal"
# gdalinfo --version

- name: Install dependencies
run: |
pip install -r requirements.txt -r requirements_dev.txt
pip install .
# - name: Test import
# run: python -c "import lidar; print('lidar import successful')"
52 changes: 39 additions & 13 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,53 @@ name: Windows build
jobs:
test-windows:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.12"]

defaults:
run:
shell: bash -el {0}

steps:
- uses: actions/checkout@v4
- name: Install miniconda

- name: Setup Python
uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
python-version: 3.9
python-version: ${{ matrix.python-version }}
channels: conda-forge,defaults
channel-priority: true
miniconda-version: latest

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Testing conda
run: |
conda info
conda list
- name: Install GDAL
run: conda install -c conda-forge gdal --yes
- name: Test GDAL installation
run: |
python -c "from osgeo import gdal"
gdalinfo --version
conda install -c conda-forge mamba --yes
mamba install -c conda-forge gdal pyproj richdem --yes
# - name: Test GDAL installation
# run: |
# python -c "from osgeo import gdal"
# gdalinfo --version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir Cython
pip install -r requirements.txt
pip install .
# - name: Discover typos with codespell
# run: codespell --skip="*.csv,*.geojson,*.json,*.js,*.html,*cff" --ignore-words-list="aci,acount,acounts,fallow,hart,hist,nd,ned,ois,wqs,watermask"
# - name: PKG-TEST
# run: |
# python -m unittest discover tests/
- name: Test import
run: python -c "import lidar; print('lidar import successful')"
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[![image](https://img.shields.io/pypi/v/lidar.svg)](https://pypi.python.org/pypi/lidar)
[![image](https://pepy.tech/badge/lidar)](https://pepy.tech/project/lidar)
[![image](https://img.shields.io/conda/vn/conda-forge/lidar.svg)](https://anaconda.org/conda-forge/lidar)
[![image](https://github.com/giswqs/lidar/workflows/build/badge.svg)](https://github.com/giswqs/lidar/actions?query=workflow%3Abuild)
[![image](https://github.com/giswqs/lidar/workflows/docs/badge.svg)](https://lidar.gishub.org)
[![image](https://github.com/opengeos/lidar/workflows/build/badge.svg)](https://github.com/opengeos/lidar/actions?query=workflow%3Abuild)
[![image](https://github.com/opengeos/lidar/workflows/docs/badge.svg)](https://lidar.gishub.org)
[![image](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![image](https://img.shields.io/twitter/follow/giswqs?style=social)](https://twitter.com/giswqs)
[![image](https://img.shields.io/badge/Donate-Buy%20me%20a%20coffee-yellowgreen.svg)](https://www.buymeacoffee.com/giswqs)
Expand All @@ -14,7 +14,7 @@
**lidar** is Python package for delineating the nested hierarchy of surface depressions in digital elevation models (DEMs). It is
particularly useful for analyzing high-resolution topographic data, such as DEMs derived from Light Detection and Ranging (LiDAR) data.

- GitHub repo: <https://github.com/giswqs/lidar>
- GitHub repo: <https://github.com/opengeos/lidar>
- Documentation: <https://lidar.gishub.org>
- PyPI: <https://pypi.org/project/lidar>
- Conda-forge: <https://anaconda.org/conda-forge/lidar>
Expand Down Expand Up @@ -116,9 +116,10 @@ If you have [Anaconda](https://www.anaconda.com/distribution/#download-section)
installed on your computer, you can create a fresh conda environment to install lidar:

```console
conda create -n py38 python=3.8
conda activate py38
conda install lidar -c conda-forge
conda create -n geo python=3.11
conda activate geo
conda install -c conda-forge mamba
mamba install -c conda-forge lidar
```

### Upgrade lidar
Expand All @@ -132,18 +133,18 @@ pip install -U lidar
If you use conda, you can update lidar to the latest version by running the following command in your terminal:

```console
conda update lidar -c conda-forge
mamba update -c conda-forge lidar
```

To install the development version from GitHub directly using Git, run the following code:

```console
pip install git+https://github.com/giswqs/lidar
pip install git+https://github.com/opengeos/lidar
```

### Dependencies

lidar's Python dependencies are listed in its [requirements.txt](https://github.com/giswqs/lidar/blob/master/requirements.txt) file. In
lidar's Python dependencies are listed in its [requirements.txt](https://github.com/opengeos/lidar/blob/master/requirements.txt) file. In
addition, lidar has a C library dependency: GDAL &gt;=1.11.2. How to
install GDAL in different operating systems will be explained below.
More information about GDAL can be found [here](https://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries).
Expand Down Expand Up @@ -201,9 +202,10 @@ The instruction below assumes that you have installed [Anaconda](https://www.ana
environment and install required packages

```console
conda create -n py38 python=3.8
conda activate py38
conda install lidar -c conda-forge
conda create -n geo python=3.11
conda activate geo
conda install -c conda-forge mamba
mamba install -c conda-forge lidar
```

When installing the **lidar** package, if you encounter an error
Expand Down Expand Up @@ -356,7 +358,7 @@ little bit helps, and credit will always be given. You can contribute in many wa

#### Report Bugs

Report bugs at <https://github.com/giswqs/lidar/issues>.
Report bugs at <https://github.com/opengeos/lidar/issues>.

If you are reporting a bug, please include:

Expand All @@ -378,7 +380,7 @@ lidar could always use more documentation, whether as part of the official lidar

#### Submit Feedback

The best way to send feedback is to file an issue at <https://github.com/giswqs/lidar/issues>.
The best way to send feedback is to file an issue at <https://github.com/opengeos/lidar/issues>.

If you are proposing a feature:

Expand All @@ -390,7 +392,7 @@ If you are proposing a feature:

Ready to contribute? Here's how to set up _lidar_ for local development.

1. Fork the [lidar](https://github.com/giswqs/lidar) repo on GitHub.
1. Fork the [lidar](https://github.com/opengeos/lidar) repo on GitHub.

2. Clone your fork locally:

Expand Down Expand Up @@ -440,7 +442,7 @@ Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.md.
3. The pull request should work for Python 3.7 and 3.8. Check <https://github.com/giswqs/lidar/actions> and make sure that the tests pass for all supported Python versions.
3. The pull request should work for Python 3.7 and 3.8. Check <https://github.com/opengeos/lidar/actions> and make sure that the tests pass for all supported Python versions.

## Credits

Expand Down
Loading

0 comments on commit ab29205

Please sign in to comment.