From a3e265d099ec9f7023bc99afc103b8fe1039b343 Mon Sep 17 00:00:00 2001 From: "Jason T. Brown" Date: Wed, 9 Dec 2020 12:19:07 -0500 Subject: [PATCH 1/4] python deprecation to setup_requires enable use of this in docs build Signed-off-by: Jason T. Brown --- pyrasterframes/src/main/python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrasterframes/src/main/python/setup.py b/pyrasterframes/src/main/python/setup.py index 021ff574d..37618b037 100644 --- a/pyrasterframes/src/main/python/setup.py +++ b/pyrasterframes/src/main/python/setup.py @@ -190,7 +190,6 @@ def dest_file(self, src_file): numpy, pandas, tabulate, - deprecation, ], setup_requires=[ pytz, @@ -211,6 +210,7 @@ def dest_file(self, src_file): fiona, rasterio, folium, + deprecation, ], tests_require=[ pytest, From 8b4e10dd0aed1c8a3197a05c71c964a6a94d3b1d Mon Sep 17 00:00:00 2001 From: "Jason T. Brown" Date: Wed, 9 Dec 2020 12:35:16 -0500 Subject: [PATCH 2/4] Revert "python deprecation to setup_requires" This reverts commit a3e265d099ec9f7023bc99afc103b8fe1039b343. --- pyrasterframes/src/main/python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrasterframes/src/main/python/setup.py b/pyrasterframes/src/main/python/setup.py index 37618b037..021ff574d 100644 --- a/pyrasterframes/src/main/python/setup.py +++ b/pyrasterframes/src/main/python/setup.py @@ -190,6 +190,7 @@ def dest_file(self, src_file): numpy, pandas, tabulate, + deprecation, ], setup_requires=[ pytz, @@ -210,7 +211,6 @@ def dest_file(self, src_file): fiona, rasterio, folium, - deprecation, ], tests_require=[ pytest, From ff8a8e4c44e2f00905d06b5621e6f9c5dc924aef Mon Sep 17 00:00:00 2001 From: "Jason T. Brown" Date: Thu, 10 Dec 2020 11:46:48 -0500 Subject: [PATCH 3/4] explicit deployment of python project in sbt makeSite command, via pySetup develop Signed-off-by: Jason T. Brown --- pyrasterframes/build.sbt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyrasterframes/build.sbt b/pyrasterframes/build.sbt index 5a4fcb657..c6e3b42dd 100644 --- a/pyrasterframes/build.sbt +++ b/pyrasterframes/build.sbt @@ -9,7 +9,9 @@ Python / doc := (Python / doc / target).toTask.dependsOn( Def.sequential( assembly, Test / compile, - pySetup.toTask(" pweave --quick True") + pySetup.toTask(" develop"), + pySetup.toTask(" pweave --quick True"), + pySetup.toTask(" develop --uninstall") // put environment back how it was ) ).value From f4cbd38f4197a5ca86b463ee5e85bbd257fa258d Mon Sep 17 00:00:00 2001 From: "Jason T. Brown" Date: Thu, 10 Dec 2020 16:19:19 -0500 Subject: [PATCH 4/4] update readme for python setup --- pyrasterframes/README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pyrasterframes/README.md b/pyrasterframes/README.md index b7c738423..cb3e458e2 100644 --- a/pyrasterframes/README.md +++ b/pyrasterframes/README.md @@ -80,6 +80,17 @@ As a tip, know that `sbt` is much faster if run in "interactive" mode, where you and subsequent commands are invoked via an interactive shell. But for context clarity, we'll prefix each command example below with `sbt`. +## Basic Python environment + +Recommend the following steps to set up a conda environment with a few requirements. + +```bash +$ conda create -n $ENV_NAME python==3.7 +$ conda activate $ENV_NAME +($ENV_NAME) $ conda install -c conda-forge --yes --file pyrasterframes/src/main/python/requirements-condaforge.txt +``` + +Run the various `sbt` commands below with this environment activated. ## Running Tests @@ -98,8 +109,8 @@ sbt pyrasterframes/test # alias 'pyTest' After running `sbt pyrasterframes/package`, you can run tests more directly in the `src/main/python` directory like this: ```bash -python -m unittest tests/RasterFunctionsTests.py -python -m unittest tests/RasterFunctionsTests.py -k test_rf_agg_overview_raster +($ENV_NAME) $ python setup.py test # all tests +($ENV_NAME) $ python setup.py test --addopts "-k rf_agg_overview_raster" # tests matching pattern ``` ## Running Python Markdown Sources