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

Nox Sessions #175

Merged
merged 10 commits into from
Dec 29, 2023
Merged

Nox Sessions #175

merged 10 commits into from
Dec 29, 2023

Conversation

fernando-aristizabal
Copy link
Member

@fernando-aristizabal fernando-aristizabal commented Dec 22, 2023

This PR implements nox sessions to automate pre-commit hooks (linting), tests, coverage, and doc building. It closes #172.

Additions

  • added .coveragerc to configure coverage report
  • added pytest options to pyproject.toml as to just use pytest to run memray, coverage, etc
    • added filter warnings to pytest options
  • added noxfile.py to automate linting, testing, coverage, and doc building
  • added compile_readme_and_arrange_docs.py to sphinx Makefile
  • added pypandoc as dependency to make pandoc python package installable
  • added docs/pandoc where pypandoc install pandoc to .gitignore
  • added pandoc pathing variables to sphinx/conf.py
  • added dirs to be excluded within flake8 and black to just have to run those commands

Removals

  • N/A

Changes

  • edited compile_readme_and_arrange_docs.py and sphinx/Makefile to use pypandoc
  • moved requirements/core.txt to requirements.txt
  • update optional-dependencies within pyproject.toml to decompose dev dependency group
  • updated Issue and PR templates
  • updated CONTRIBUTING.md to latest recommended usage
  • modified tabulation.py for DeprecationWarning with use of .drop()
  • updated geopandas backend to pyogrio to address gpkg io issue
  • changed nox MIN_COVERAGE_PERC = 5 due to nox and gh actions coverage issue

Testing

  1. All tests are covered.

Todos

  • Add pyright static type check (or similiar) to project. Then a nox sesssion and update CONTRIBUTING.MD.
  • Add a version bumper such as those here.
  • Add a nox session to publish release to PyPi.
  • Add setup.cfg contents to pyproject.toml. Consolidate any other configurations to pyproject.toml.
  • See if config.py is needed or if it can moved within src/gval to be used elsewhere.
    • Possibly used within sphinx/conf.py or docs/compile_readme_and_arrange_docs.py
  • Update GH workflow to use nox instead of tools directly.
  • See why nox tests have low test coverage.
    • update .coveragerc to 90-95 once complete

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards documented here
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Reviewers requested with the Reviewers tool ➡️

- added `noxfile.py` to automate linting, testing, coverage, and doc building
- moved `requirements/core.txt` to `requirements.txt`
- update optional-dependencies within `pyproject.toml` to decompose dev dependency group
- added `compile_readme_and_arrange_docs.py` to sphinx `Makefile`
- added pypandoc as dependency to make pandoc python package installable
- edited `compile_readme_and_arrange_docs.py` and `sphinx/Makefile` to use pypandoc
- added `docs/pandoc` where pypandoc install pandoc to `.gitignore`
- added pandoc pathing variables to `sphinx/conf.py`
- Updated Issue and PR templates
- Updated `CONTRIBUTING.md` to latest recommended usage
- Linting changes
- Added `.coveragerc` to configure coverage report
- Added `pytest` options to `pyproject.toml`
- Added filter warnings to pytest options.
- Modified `tabulation.py` for `DeprecationWarning` with use of `.drop()`
- Future TODO: add version bump nox session
- Future TODO: use nox in GH actions?
- Future TODO: increase coverage to 95%+.
    - Update `CONTRIBUTING.MD`, `PULL_REQUEST_TEMPLATE.md` ,and `.coveragerc` to reflect this requirement.
@fernando-aristizabal fernando-aristizabal added the testing Related to testing functionality. label Dec 22, 2023
@fernando-aristizabal fernando-aristizabal self-assigned this Dec 22, 2023
Copy link
Collaborator

@GregoryPetrochenkov-NOAA GregoryPetrochenkov-NOAA left a comment

Choose a reason for hiding this comment

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

No issues aside from my one comment. Feel free to address it or not depending on your answer.



'''
@nox.session(python=LINTING_VERSION, tags=["linting"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason to leave in this commented function?

Copy link
Member Author

Choose a reason for hiding this comment

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

I went ahead and added a comment noting this code block as a PLACEHOLDER for future work.

@GregoryPetrochenkov-NOAA GregoryPetrochenkov-NOAA merged commit 0cb9654 into main Dec 29, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Related to testing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Nox Tests
2 participants