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

WIP Update Dependencies and Requirements to use pyproject.toml #1528

Closed

Conversation

mfixstsci
Copy link
Collaborator

Currently JWQL is using three different methods to track dependencies and build our python environment. It would be nice to shrink this down to one method and keep track of them in the pyproject.toml

@zacharyburnett
Copy link
Collaborator

Looks good so far! You can likely remove ruff and pytest, and limit these dependencies only to those imported in the code. I'll draft up a release workflow too

@mfixstsci
Copy link
Collaborator Author

@zacharyburnett Thanks for the PR, I went ahead and added the upper and lower bound pins. I also added the minimum python version. I guess the next steps would be to update the CI pipeline to get the tests passing. I am sure there is a nifty and much easier way to get the package installed with the pyproject.toml instead of executing a bunch of bash commands. Ideally the minimum version we would like to support at this point is 3.11 so the testing matrix will need to be updated to include python 3.11 and 3.12.

@mfixstsci
Copy link
Collaborator Author

@zacharyburnett so close, looks like something with the mast portal is causing the test failure. I will investigate further tomorrow.

Copy link
Collaborator

@zacharyburnett zacharyburnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mfixstsci use these changes with an environment.yml that includes firefox:

# environment.yml

dependencies:
  - firefox
  - python

on: [push, pull_request]
on:
push:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defaults:
run:
shell: micromamba-shell {0}

types: [ released ]
pull_request:
workflow_dispatch:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defaults:
run:
shell: micromamba-shell {0}

steps:
- uses: actions/checkout@v4

- uses: mamba-org/provision-with-micromamba@v15
- uses: actions/setup-python@v5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: actions/setup-python@v5
- uses: mamba-org/setup-micromamba@v1

Comment on lines +35 to +37
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
environment-name: jwql-${{ runner.os }}-py${{ matrix.python-version }}
environment-file: environment.yaml
create-args: >-
python=${{ matrix.python-version }}
init-shell: none
generate-run-shell: true

Comment on lines +24 to +26
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: jwql-${{ runner.os }}-py${{ matrix.python-version }}
environment-file: environment.yaml
create-args: >-
python=${{ matrix.python-version }}
init-shell: none
generate-run-shell: true

strategy:
max-parallel: 5
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
os: [ubuntu-latest, macos-latest]
os: [ "ubuntu-latest", "macos-latest" ]

matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.9, "3.10"]

python-version: ["3.11"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.11"]
python-version: [ "3.11" ]

@zacharyburnett
Copy link
Collaborator

superseded by #1568

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants