-
Notifications
You must be signed in to change notification settings - Fork 8
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
Update code contribution instructions and Nox sessions #262
Open
namurphy
wants to merge
9
commits into
HinodeXRT:main
Choose a base branch
from
namurphy:contributing-instructions-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9c0cbdc
Update nox session for running tests
namurphy 7cfa793
Finish renaming nox session
namurphy 18328b8
Update contributing instructions
namurphy a2dbe58
Remove extraneous Nox sessions for docs
namurphy ae4a5a6
Finish renaming nox sessions
namurphy a3607f9
Finish consolidating Nox sessions
namurphy e067040
Minor updates
namurphy 61d3558
[Fix] Package templating
nabobalis 78baa2a
Revert changes to avoid conflict with open PRs
nabobalis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
target-version = "py310" | ||
show-fixes = true | ||
extend-exclude = [ | ||
".jupyter", | ||
"__pycache__", | ||
"_build", | ||
"_dev", | ||
] | ||
|
||
[lint] | ||
# Find info about ruff rules at: https://docs.astral.sh/ruff/rules | ||
extend-select = [ | ||
"ARG", # flake8-unused-arguments | ||
"B", # flake8-bugbear | ||
"BLE", # flake8-blind-except | ||
"C4", # flake8-comprehensions | ||
"C90", # mccabe | ||
"COM818", # trailing-comma-on-bare-tuple | ||
"FBT003", # flake8-boolean-trap | ||
"FLY", # flynt | ||
"I", # isort | ||
"ICN", # flake8-import-conventions | ||
"INP", # flake8-no-pep420 | ||
"INT", # flake8-gettext | ||
"ISC", # flake8-implicit-str-concat | ||
"N", # pep8-naming | ||
"NPY", # numpy-deprecated-type-alias | ||
"PD", # pandas-vet | ||
"PERF", # perflint | ||
"PGH", # pygrep-hooks | ||
"PIE", # flake8-pie | ||
"PLC", # pylint convention | ||
"PLE", # pylint errors | ||
"PLW", # pylint warnings | ||
"PT", # flake8-pytest-style | ||
"PTH", # flake8-use-pathlib | ||
"PYI", # flake8-pyi | ||
"RSE", # flake8-raise | ||
"RUF005",# collection-literal-concatenation | ||
"RUF006", # asyncio-dangling-task | ||
"RUF007", # pairwise-over-zipped | ||
"RUF008", # mutable-dataclass-default | ||
"RUF009", # function-call-in-dataclass-default-argument | ||
"RUF010", # explicit-f-string-type-conversion | ||
"RUF013", # implicit-optional | ||
"RUF015", # unnecessary-iterable-allocation-for-first-element | ||
"RUF016", # invalid-index-type | ||
"RUF100", # unused-noqa | ||
"RUF200", # invalid-pyproject-toml | ||
"S", # flake8-bandit | ||
"SIM", # flake8-simplify | ||
"TCH", # flake8-type-checking | ||
"TID", # flake8-tidy-imports | ||
"TRY", # tryceratops | ||
"UP", # pyupgrade | ||
"W", # pycodestyle warnings | ||
] | ||
ignore = [ | ||
"C901", # is too complex | ||
"E501", # line-too-long | ||
"ISC001", # single-line-implicit-string-concatenation (formatter conflict) | ||
"N802", # invalid-function-name | ||
"N803", # invalid-argument-name | ||
"N806", # non-lowercase-variable-in-function | ||
"N816", # mixed-case-variable-in-global-scope | ||
"PLC2401", # non-ascii-name | ||
"S101", # asserts | ||
"SIM108", # if-else-block-instead-of-if-exp | ||
"TRY003", # raise-vanilla-args | ||
] | ||
|
||
[lint.per-file-ignores] | ||
"docs/conf.py" = [ | ||
"E402", # Module imports not at top of file | ||
"INP001", # Implicit-namespace-package. The examples are not a package. | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,53 @@ | ||
import nox | ||
|
||
nox.options.sessions = ["tests", "linters"] | ||
|
||
nox.options.sessions = ["tests"] | ||
python_versions = ("3.10", "3.11", "3.12") | ||
|
||
sphinx_paths = ["docs", "docs/_build/html"] | ||
sphinx_fail_on_warnings = ["-W", "--keep-going"] | ||
sphinx_builder = ["-b", "html"] | ||
sphinx_opts = sphinx_paths + sphinx_fail_on_warnings + sphinx_builder | ||
sphinx_no_notebooks = ["-D", "nbsphinx_execute=never"] | ||
sphinx_nitpicky = ["-n"] | ||
|
||
pytest_options = [ | ||
"--ignore", | ||
"xrtpy/response/effective_area.py", | ||
"--ignore", | ||
"xrtpy/response/temperature_response.py", | ||
] | ||
|
||
|
||
@nox.session(python=python_versions) | ||
@nox.session | ||
def tests(session): | ||
session.install(".[dev,tests]") | ||
""" | ||
Run tests with pytest. | ||
""" | ||
pytest_options = {} | ||
session.install(".[tests]") | ||
session.run("pytest", *pytest_options) | ||
|
||
|
||
@nox.session | ||
def linters(session): | ||
""" | ||
Run all pre-commit hooks on all files. | ||
""" | ||
session.install("pre-commit") | ||
session.run("pre-commit", "run", "--all-files", *session.posargs) | ||
|
||
|
||
@nox.session | ||
def import_package(session): | ||
""" | ||
Import xrtpy. | ||
""" | ||
session.install(".") | ||
session.run("python", "-c", 'import xrtpy') # fmt: skip | ||
session.run("python", "-c", "import xrtpy") | ||
|
||
|
||
@nox.session | ||
def build_docs(session): | ||
session.install(".[dev,docs]") | ||
session.run( | ||
"sphinx-build", | ||
*sphinx_opts, | ||
*session.posargs, | ||
def docs(session): | ||
""" | ||
Build documentation with Sphinx. | ||
""" | ||
sphinx_paths = ["docs", "docs/_build/html"] | ||
sphinx_fail_on_warnings = ["-W", "--keep-going"] | ||
sphinx_builder = ["-b", "html"] | ||
sphinx_nitpicky = ["-n"] | ||
sphinx_opts = ( | ||
sphinx_paths + sphinx_fail_on_warnings + sphinx_builder + sphinx_nitpicky | ||
) | ||
|
||
|
||
@nox.session | ||
def build_docs_nitpicky(session): | ||
session.install(".[dev,docs]") | ||
session.install(".[docs]") | ||
session.run( | ||
"sphinx-build", | ||
*sphinx_opts, | ||
*sphinx_nitpicky, | ||
*session.posargs, | ||
) | ||
|
||
|
||
@nox.session | ||
def build_docs_no_examples(session): | ||
session.install(".[dev,docs]") | ||
session.run( | ||
"sphinx-build", | ||
*sphinx_opts, | ||
*sphinx_no_notebooks, | ||
*session.posargs, | ||
) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ruff handles notebook linting now. I don't think this is needed anymore.