Skip to content

Commit

Permalink
Pyproject tinkering (#83)
Browse files Browse the repository at this point in the history
* Apparently have to require the 'wheel' package be present

* setup.py: Workaround for pypa/pip#7953

* Keep flake8 happy

* Minor typos

* Comments now show only needs correct pip. The required setuptools can be specified in the requires=

* With guaranteed correct setuptools, can remove the fix for pypa/pip/issues/7953. Only need to sys.path modification to get version

* Extra github job to test on Ubuntu without conda

* Apparently need to install numpy, too

* Try without the apt-get update

* Can I sudo it?

* Remove redundant numpy install

* Rename future.pyproject.toml to pyproject.toml

* Update pyproj comments, now we have a way forward

* Just checking it fails when I think it should....

* Seems I no longer need the pip upgrade..... hmmm.....

* Update pyproj comments accordingly

* Turns out I need the pypa/pip#7953 fix for editable installs

* Turns out I need the pip>=23.0 for editable installs only. Added a note about this to pyproject.toml

* Remove old setup.py and bin/*.py

* Put back the pip upgrade, as it seems we need that when we don't have setup.py (maybe)

* Update comments about requirement for pip>=23.0
  • Loading branch information
neilflood authored May 28, 2024
1 parent 9e6b925 commit 72917d3
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 355 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,28 @@ jobs:
- name: Install dependencies
shell: bash -l {0}
run: conda install gdal cloudpickle scipy
- name: Test with testrios.py
- name: Test with testrios
shell: bash -l {0}
run: |
pip install .
testrios.py
testrios
tests-ubuntu-no-conda:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install dependencies
shell: bash -l {0}
run: |
sudo apt-get install -y --no-install-recommends \
python3-gdal python3-cloudpickle python3-scipy python3-pip
pip install --upgrade pip
- name: Test with testrios
shell: bash -l {0}
run: |
pip install .
testrios
tests-windows:
runs-on: windows-latest
Expand Down
48 changes: 0 additions & 48 deletions bin/rios_subproc.py

This file was deleted.

112 changes: 0 additions & 112 deletions bin/rios_subproc_awsbatch.py

This file was deleted.

60 changes: 0 additions & 60 deletions bin/rios_subproc_mpi.py

This file was deleted.

11 changes: 0 additions & 11 deletions bin/rioscalcstats.py

This file was deleted.

11 changes: 0 additions & 11 deletions bin/riosprintstats.py

This file was deleted.

38 changes: 0 additions & 38 deletions bin/testrios.py

This file was deleted.

30 changes: 13 additions & 17 deletions future.pyproject.toml → pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# This currently fails if the installed versions of pip and setuptools
# are too old (e.g. Ubuntu 22.04). These can be locally upgraded using
# pip install --user -U pip setuptools
#
# However, without that, the mere presence of this file as pyproject.toml
# will cause the install to fail. Not wishing to break existing recipes,
# the file is currently named future.pyproject.toml, until I work out
# what to do.
# Notes
# Currently we allow setuptools to "discover" the package directories,
# but we could specify them if required, with [tool.setuptools]/packages=

# The old setup.py currently has scripts=glob("bin/*.py"). When (or if)
# we remove setup.py, we should also remove bin/, because the new
# approach is via projects.scripts, which installs without the .py suffix

# The installation requires pip>=23.0. If not, it will fail in rather
# cryptic ways (depending exactly what options are used).
#

[build-system]
requires = ["setuptools"]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "rios"
Expand All @@ -20,19 +23,12 @@ authors = [
]
description = "Raster Input/Output Simplification"
readme = "README.md"
license = {text = "LICENSE.txt"}
license = {file = "LICENSE.txt"}

[project.optional-dependencies]
# For those computeWorkerKinds which run across multiple machines
multimachine = ["cloudpickle"]

# Currently allowing setuptools to "discover" the package directories,
# but we could specify them if required, with [project]/packages=

# The old setup.py currently has scripts=glob("bin/*.py"). When/if
# we remove setup.py, we should also remove bin/, becuase the new
# approach is via projects.scripts, which installs without the .py suffix

[project.scripts]
testrios = "rios.riostests.riostestutils:testAll"
rioscalcstats = "rios.cmdline.rioscalcstats:main"
Expand Down
Loading

0 comments on commit 72917d3

Please sign in to comment.