Skip to content

Commit

Permalink
Merge branch 'main' of github.com:natcap/invest into bugfix/1600-ufrm…
Browse files Browse the repository at this point in the history
…-preserve-source-aoi-fields
  • Loading branch information
emilyanndavis committed Sep 30, 2024
2 parents 3ec1485 + af8ce8b commit 51660ad
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 34 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
name: Check for syntax errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}

Expand All @@ -50,9 +50,9 @@ jobs:
name: Check RST syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Set up python
with:
python-version: ${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}
Expand All @@ -75,7 +75,7 @@ jobs:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
os: [windows-latest, macos-13]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch complete history for accurate versioning

Expand Down Expand Up @@ -127,27 +127,27 @@ jobs:
run: make test

- name: Upload wheel artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Wheel for ${{ matrix.os }} ${{ matrix.python-version }}
path: dist

- name: Upload conda env artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: Conda Env for ${{ matrix.os }} ${{ matrix.python-version }}
path: conda-env.txt

- name: Authenticate GCP
if: github.event_name != 'pull_request'
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_SERVICE_ACC_KEY }}

- name: Set up GCP
if: github.event_name != 'pull_request'
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v2

- name: Deploy artifacts to GCS
if: github.event_name != 'pull_request'
Expand All @@ -162,7 +162,7 @@ jobs:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
os: [windows-latest, macos-13]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch complete history for accurate versioning

Expand Down Expand Up @@ -196,9 +196,9 @@ jobs:
- name: Check long description with twine
run: twine check $(find dist -name "natcap[._-]invest*")

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: Source distribution
name: Source distribution ${{ matrix.os }} ${{ matrix.python-version }}
path: dist

# Secrets not available in PR so don't use GCP.
Expand All @@ -207,13 +207,13 @@ jobs:
# different extensions)
- name: Authenticate GCP
if: github.event_name != 'pull_request' && matrix.os == 'macos-13' && matrix.python-version == env.LATEST_SUPPORTED_PYTHON_VERSION
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_SERVICE_ACC_KEY }}

- name: Set up GCP
if: github.event_name != 'pull_request' && matrix.os == 'macos-13' && matrix.python-version == env.LATEST_SUPPORTED_PYTHON_VERSION
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v2

- name: Deploy artifacts to GCS
if: github.event_name != 'pull_request' && matrix.os == 'macos-13' && matrix.python-version == env.LATEST_SUPPORTED_PYTHON_VERSION
Expand All @@ -224,7 +224,7 @@ jobs:
runs-on: windows-latest
needs: check-syntax-errors
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch complete history for accurate versioning

Expand Down Expand Up @@ -255,7 +255,7 @@ jobs:

steps:
- name: Check out repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch complete history for accurate versioning

Expand Down Expand Up @@ -312,7 +312,7 @@ jobs:
workspace-path: ${{ github.workspace }}
binary-extension: exe
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch complete history for accurate versioning

Expand Down Expand Up @@ -369,13 +369,13 @@ jobs:
- name: Authenticate GCP
if: github.event_name != 'pull_request'
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_SERVICE_ACC_KEY }}

- name: Set up GCP
if: github.event_name != 'pull_request'
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v2

- name: Build Workbench (PRs)
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -444,20 +444,20 @@ jobs:

- name: Upload workbench binary artifact
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Workbench-${{ runner.os }}-binary
path: workbench/dist/*.${{ matrix.binary-extension }}

- name: Upload user's guide artifact (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: InVEST-user-guide
path: dist/InVEST_*_userguide.zip

- name: Upload workbench logging from puppeteer
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ runner.os }}_puppeteer_log.zip'
Expand All @@ -476,7 +476,7 @@ jobs:

- name: Upload workspace on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: InVEST-failed-${{ runner.os }}-workspace
path: ${{ matrix.workspace-path}}
Expand All @@ -486,11 +486,11 @@ jobs:
needs: check-syntax-errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch complete history for accurate versioning

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}

Expand All @@ -501,20 +501,20 @@ jobs:
- run: make sampledata sampledata_single

- name: Upload sample data artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: InVEST-sample-data
path: dist/*.zip

- name: Authenticate GCP
if: github.event_name != 'pull_request'
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_SERVICE_ACC_KEY }}

- name: Set up GCP
if: github.event_name != 'pull_request'
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v2

- name: Deploy artifacts to GCS
if: github.event_name != 'pull_request'
Expand Down
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Unreleased Changes
(https://github.com/natcap/invest/issues/1598)
* Fixed a bug that was allowing readonly workspace directories on Windows
(https://github.com/natcap/invest/issues/1599)
* Fixed a bug that, in certain scenarios, caused a datastack to be saved
with relative paths when the Relative Paths checkbox was left unchecked
(https://github.com/natcap/invest/issues/1609)
* Urban Flood Risk
* Fields present on the input AOI vector are now retained in the output.
(https://github.com/natcap/invest/issues/1600)
Expand Down
2 changes: 1 addition & 1 deletion constraints_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ GDAL<3.8.5
# Pyinstaller 6.10 breaks our windows builds. Until we can figure out the
# root cause, let's cap the versions to those that work.
# https://github.com/natcap/invest/issues/1622
pyinstaller<6.10
#pyinstaller<6.10
5 changes: 1 addition & 4 deletions exe/hooks/rthook.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import sys
import os
import multiprocessing
import platform

multiprocessing.freeze_support()
import sys

os.environ['PROJ_LIB'] = os.path.join(sys._MEIPASS, 'proj')

Expand Down
6 changes: 6 additions & 0 deletions src/natcap/invest/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import multiprocessing
import sys

# We want to guarantee that this is called BEFORE any other processes start,
# which could happen at import time.
if __name__ == '__main__':
multiprocessing.freeze_support()

from . import cli

if __name__ == '__main__':
Expand Down
5 changes: 4 additions & 1 deletion workbench/src/renderer/components/SaveAsModal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ class SaveAsModal extends React.Component {
}

handleShow() {
this.setState({ show: true });
this.setState({
relativePaths: false,
show: true,
});
}

handleChange(event) {
Expand Down

0 comments on commit 51660ad

Please sign in to comment.