Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for ISIS version update #17

Merged
merged 16 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .bumpversion.cfg

This file was deleted.

38 changes: 18 additions & 20 deletions .github/workflows/code-cover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,37 @@ jobs:
shell: bash -l {0}
steps:
- name: Conda setup
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: false
channel-priority: flexible
channels: usgs-astrogeology, conda-forge
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install ISIS
run: |
micromamba create --name isis
micromamba activate isis
micromamba install -y isis=7.2.0
environment-name: isis
create-args: >-
isis=8.0.3
condarc: |
channels:
- usgs-astrogeology
- conda-forge
channel-priority: flexible
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup test-resources/
run: |
mkdir $GITHUB_WORKSPACE/test-resources/
- name: Download IMG
run: curl "https://hirise-pds.lpl.arizona.edu/PDS/EDR/PSP/ORB_010500_010599/PSP_010502_2090/PSP_010502_2090_RED5_0.IMG" -o $GITHUB_WORKSPACE/test-resources/PSP_010502_2090_RED5_0.img
- name: Install kalasiris
run: |
micromamba create --name kal
micromamba activate kal
python -m pip install -e .
run: pip install -e .
- name: Test with pytest and generate coverage report
run: |
micromamba activate kal
micromamba install -y pytest
micromamba install -y pytest-cov
export ISISROOT=$MAMBA_ROOT_PREFIX/envs/isis
export ISISDATA=$MAMBA_ROOT_PREFIX/envs/isis
pytest --cov=./kalasiris --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbse: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
25 changes: 13 additions & 12 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,23 @@ jobs:
strategy:
matrix:
# isis 4.4.0 apparently needs jpeg 9b, which is missing
isis-version: [5.0.2, 6.0.0, 7.2.0]
# isis-version: 5.0.2 and 6.0.0 don't have a high enough Python for pyproject.toml
isis-version: [7.2.0, 8.0.3]

steps:
- name: Conda setup
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: false
channel-priority: flexible
channels: usgs-astrogeology, conda-forge
environment-name: isis
create-args: >-
isis=${{ matrix.isis-version }}
condarc: |
channels:
- usgs-astrogeology
- conda-forge
channel-priority: flexible
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Download IMG artifact
Expand All @@ -52,11 +58,6 @@ jobs:
run: |
tar -xvf img.tar
ls -R
- name: Install ISIS
run: |
micromamba create --name isis
micromamba activate isis
micromamba install -y isis=${{ matrix.isis-version }}
- name: Lint with flake8
run: |
micromamba activate isis
Expand All @@ -66,7 +67,7 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 kalasiris tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test Install
run: python -m pip install -e .
run: pip install -e .
- name: Test with pytest
run: |
micromamba activate isis
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ venv.bak/
.spyderproject
.spyproject

# IntelliJ PyCharm directory
.idea/

# Rope project settings
.ropeproject

Expand Down
66 changes: 0 additions & 66 deletions .travis.yml

This file was deleted.

18 changes: 9 additions & 9 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ Here is an example workflow for working on a bug that was discovered:
| Checkout hotfix, may need to | | | |
| ``git rebase master`` if master has advanced. | | | |
+------------------------------------------------+ | +-----------+
| Commit with bump2version:: | | | a.b.d-dev |
| Commit with bump-my-version:: | | | a.b.d-dev |
| | | | |
| bump2version patch | | | |
| bump-my-version bump -v patch | | | |
+------------------------------------------------+ +-------+ |
| Is there a suitable first `failing-tests` | | fail | |
| commit? If not, decide how important it is. | | in | |
Expand Down Expand Up @@ -243,7 +243,7 @@ Here is an example workflow for working on a bug that was discovered:
| This wraps up this branch and readies it for | | | a.b.d |
| merging with master:: | | | |
| | | | |
| bump2version release --tag | | | |
| bump-my-version release --tag | | | |
| --tag-message | | | |
| 'something descriptive' | | | |
+------------------------------------------------+--------+ | |
Expand Down Expand Up @@ -277,7 +277,7 @@ Here is an example workflow for working on a bug that was discovered:

The workflow for a minor feature is identical to the above, but we
might name the branch *feature* or *minor-feature* instead of
*hotfix*, and we would apply ``bump2version`` differently.
*hotfix*, and we would apply ``bump-my-version`` differently.

A **Minor Feature** is defined as new, backwards compatible functionality.

Expand All @@ -286,7 +286,7 @@ A **Minor Feature** is defined as new, backwards compatible functionality.
+================================================+=========+=======+===========+
| After release a.b.c, the state is: | master | pass | a.b.c |
+------------------------------------------------+---------+ +-----------+
| 1st bump2version: ``bump2version minor`` | feature | | a.c.0-dev |
| 1st bump: ``bump-my-version bump -v minor`` | feature | | a.c.0-dev |
+------------------------------------------------+ +-------+ +
| In this case, commits might look like this: | | fail | |
| | | | |
Expand All @@ -295,9 +295,9 @@ A **Minor Feature** is defined as new, backwards compatible functionality.
| #. Wrote some tests | | | |
| #. Feature is now complete! | | | |
+------------------------------------------------+ +-------+-----------+
| 2nd bump2version:: | | pass | a.c.0 |
| 2nd bump:: | | pass | a.c.0 |
| | | | |
| bump2version release | | | |
| bump-my-version bump release | | | |
| --tag --tag-message '...' | | | |
+------------------------------------------------+---------+-------+-----------+

Expand All @@ -309,7 +309,7 @@ similar to the Minor Feature Workflow above, simply:
+================================================+=========+=======+===========+
| After release a.b.c, the state is: | master | pass | a.b.c |
+------------------------------------------------+---------+ +-----------+
| 1st bump2version: ``bump2version major`` | feature | | b.0.0-dev |
| 1st bump: ``bump-my-version bump -v major`` | feature | | b.0.0-dev |
+------------------------------------------------+ +-------+-----------+
| 2nd bump2version | | pass | b.0.0 |
+------------------------------------------------+---------+-------+-----------+
Expand All @@ -322,7 +322,7 @@ similar to the Minor Feature Workflow above, simply:
.. Make sure all your changes are committed (including an entry in HISTORY.rst).
.. Then run::
..
.. $ bump2version release # possibly: major / minor / patch
.. $ bump-my-version bump release # possibly: major / minor / patch
.. $ git push
.. $ git push --tags
..
Expand Down
9 changes: 9 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ and the release date, in year-month-day format (see examples below).
Unreleased
----------

1.11.0 (2024-07-10)
-------------------

Fixed
+++++
* version.py - ISIS 8.0.3 renamed the file that the ISIS version information was recorded in,
and this fix also checks this new location, as well as the old.



1.10.0 (2023-12-27)
-------------------
Expand Down
24 changes: 17 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ lint/flake8: ## check style with flake8
lint/black: ## check style with black
black --check kalasiris tests

lint: lint/flake8 lint/black
twine check dist/*
lint/ufmt: ## check format with ufmt
ufmt check kalasiris
ufmt check tests

lint: lint/flake8 lint/black lint/ufmt


test: test-resources ## run tests quickly with the default Python
python -m pytest
Expand All @@ -88,12 +92,13 @@ test-ISIS3DATA: ## Download a minimal $ISIS3DATA for testing
rsync -rltzvR --delete isisdist.astrogeology.usgs.gov::isis3data/data/./mro/translations/hiriseBandBin.trn test-ISIS3DATA/
rsync -rltzvR --delete isisdist.astrogeology.usgs.gov::isis3data/data/./mro/translations/hiriseArchive.trn test-ISIS3DATA/

test-resources: test-ISIS3DATA ## Download what we need for testing
# test-resources: test-ISIS3DATA ## Download what we need for testing
test-resources: ## Download what we need for testing
mkdir test-resources
$(DOWNLOAD) https://hirise-pds.lpl.arizona.edu/PDS/EDR/PSP/ORB_010500_010599/PSP_010502_2090/PSP_010502_2090_RED5_0.IMG test-resources/PSP_010502_2090_RED5_0.img

coverage: ## check code coverage quickly with the default Python
coverage run --source kalasiris setup.py test
coverage run --source kalasiris -m pytest
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html
Expand All @@ -111,13 +116,18 @@ fakeISISROOT-docs: ## create a suite of fake ISIS program filenames
servedocs: docs ## compile the docs watching for changes
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .

release-check: dist ## check state of distribution
twine check dist/*

release: dist ## package and upload a release
twine upload -r kalasiris dist/*

dist: clean ## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
python -m build
ls -l dist

develop: clean ## install the package in an editable format for development
pip install --no-deps -e .

install: clean ## install the package to the active Python's site-packages
python setup.py install
pip install
24 changes: 24 additions & 0 deletions environment_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This is for creating the very minimal kaldev environment for testing kalasiris.
# It *must* be stacked on top of an ISIS environment.
# > conda create -n kaldev python=3.8
# > conda activate kaladev
# > conda env update -f environment_dev.yml
#
channels:
- conda-forge
- defaults
dependencies:
- black
- build
- bump-my-version
- flake8
- icecream
- pytest
- pytest-cov
- sphinx
- sphinxcontrib
- sphinxcontrib-apidoc
- twine
- pip
- pip:
- ufmt
2 changes: 1 addition & 1 deletion kalasiris/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

__author__ = """Ross A. Beyer"""
__email__ = "[email protected]"
__version__ = "1.10.0"
__version__ = "1.11.0-dev"

from .kalasiris import * # noqa: F401,F403
from .k_funcs import * # noqa: F401,F403
Expand Down
2 changes: 1 addition & 1 deletion kalasiris/kalasiris.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# This file shall have *NO* non-Standard Library dependencies.

# kalasiris library version:
__version__ = "1.10.0"
__version__ = "1.11.0-dev"

# Set a logger:
logger = logging.getLogger(__name__)
Expand Down
Loading
Loading