diff --git a/.copier-answers.yml b/.copier-answers.yml index b99f901..f472ea9 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: 2dae20a +_commit: v0.3.1 _src_path: gh:LSSTDESC/RAIL-project-template author_email: later@later.com author_name: LSST Dark Energy Science Collaboration (DESC) diff --git a/.github/ISSUE_TEMPLATE/0-general_issue.md b/.github/ISSUE_TEMPLATE/0-general_issue.md new file mode 100644 index 0000000..84bb0d7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/0-general_issue.md @@ -0,0 +1,8 @@ +--- +name: General issue +about: Quickly create a general issue +title: '' +labels: '' +assignees: '' + +--- \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/1-bug_report.md b/.github/ISSUE_TEMPLATE/1-bug_report.md new file mode 100644 index 0000000..d4917b5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-bug_report.md @@ -0,0 +1,17 @@ +--- +name: Bug report +about: Tell us about a problem to fix +title: 'Short description' +labels: 'bug' +assignees: '' + +--- +**Bug report** + + +**Before submitting** +Please check the following: + +- [ ] I have described the situation in which the bug arose, including what code was executed, information about my environment, and any applicable data others will need to reproduce the problem. +- [ ] I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a descriprion of what I expected instead. +- [ ] If I have a solution in mind, I have provided an explanation and/or pseudocode and/or task list. diff --git a/.github/ISSUE_TEMPLATE/2-feature_request.md b/.github/ISSUE_TEMPLATE/2-feature_request.md new file mode 100644 index 0000000..50ab544 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2-feature_request.md @@ -0,0 +1,18 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: 'Short description' +labels: 'enhancement' +assignees: '' + +--- + +** Feature request** + + +**Before submitting** +Please check the following: + +- [ ] I have described the purpose of the suggested change, specifying what I need the enhancement to accomplish, i.e. what problem it solves. +- [ ] I have included any relevant links, screenshots, environment information, and data relevant to implementing the requested feature, as well as pseudocode for how I want to access the new functionality. +- [ ] If I have ideas for how the new feature could be implemented, I have provided explanations and/or pseudocode and/or task lists for the steps. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 76e043c..87b1e80 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,63 +1,8 @@ - - -## Change Description - -- [ ] My PR includes a link to the issue that I am addressing - - - -## Solution Description - - +## Problem & Solution Description (including issue #) ## Code Quality -- [ ] I have read the Contribution Guide -- [ ] My code follows the code style of this project -- [ ] My code builds (or compiles) cleanly without any errors or warnings -- [ ] My code contains relevant comments and necessary documentation - -## Project-Specific Pull Request Checklists - - -### Bug Fix Checklist -- [ ] My fix includes a new test that breaks as a result of the bug (if possible) -- [ ] My change includes a breaking change - - [ ] My change includes backwards compatibility and deprecation warnings (if possible) - -### New Feature Checklist -- [ ] I have added or updated the docstrings associated with my feature using the [NumPy docstring format](https://numpydoc.readthedocs.io/en/latest/format.html) -- [ ] I have updated the tutorial to highlight my new feature (if appropriate) -- [ ] I have added unit/End-to-End (E2E) test cases to cover my new feature -- [ ] My change includes a breaking change - - [ ] My change includes backwards compatibility and deprecation warnings (if possible) - -### Documentation Change Checklist -- [ ] Any updated docstrings use the [NumPy docstring format](https://numpydoc.readthedocs.io/en/latest/format.html) - -### Build/CI Change Checklist -- [ ] If required or optional dependencies have changed (including version numbers), I have updated the README to reflect this -- [ ] If this is a new CI setup, I have added the associated badge to the README - - - -### Other Change Checklist -- [ ] Any new or updated docstrings use the [NumPy docstring format](https://numpydoc.readthedocs.io/en/latest/format.html). -- [ ] I have updated the tutorial to highlight my new feature (if appropriate) -- [ ] I have added unit/End-to-End (E2E) test cases to cover any changes -- [ ] My change includes a breaking change - - [ ] My change includes backwards compatibility and deprecation warnings (if possible) +- [ ] My code follows [the code style of this project](https://rail-hub.readthedocs.io/en/latest/source/contributing.html#naming-conventions) +- [ ] I have written unit tests or justified all instances of `#pragma: no cover`; in the case of a bugfix, a new test that breaks as a result of the bug has been added +- [ ] My code contains relevant comments and necessary documentation for future maintainers; the change is reflected in applicable demos/tutorials (with output cleared!) and added/updated docstrings use the [NumPy docstring format](https://numpydoc.readthedocs.io/en/latest/format.html) +- [ ] Any breaking changes, described above, are accompanied by backwards compatibility and deprecation warnings diff --git a/.github/workflows/add-issue-to-project-tracker.yml b/.github/workflows/add-issue-to-project-tracker.yml index be16f58..37daf55 100644 --- a/.github/workflows/add-issue-to-project-tracker.yml +++ b/.github/workflows/add-issue-to-project-tracker.yml @@ -4,6 +4,8 @@ on: issues: types: - opened + pull_request: + types: [opened, reopened] jobs: add-to-project: diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 6b90f3e..139eb24 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -12,16 +12,12 @@ on: jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.8', '3.9', '3.10'] - steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: '3.11' - name: Install dependencies run: | sudo apt-get update @@ -33,5 +29,6 @@ jobs: - name: Analyze code with linter run: | pylint -rn -sn --recursive=y ./src + pylint -rn -sn --recursive=y ./tests + # the following line allows the CI test to pass, even if pylint fails continue-on-error: true - diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 5367eb6..a616f50 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,5 +1,5 @@ # This workflow will upload a Python Package using Twine when a release is created -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries +# For more information see: https://github.com/pypa/gh-action-pypi-publish#trusted-publishing # This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by @@ -19,7 +19,8 @@ jobs: deploy: runs-on: ubuntu-latest - + permissions: + id-token: write steps: - uses: actions/checkout@v3 - name: Set up Python @@ -33,7 +34,4 @@ jobs: - name: Build package run: python -m build - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 91631f9..890242b 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -7,13 +7,16 @@ on: schedule: - cron: 45 6 * * * + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + jobs: build: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10'] + python-version: ['3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/testing-and-coverage.yml b/.github/workflows/testing-and-coverage.yml index b73c2a9..c85541e 100644 --- a/.github/workflows/testing-and-coverage.yml +++ b/.github/workflows/testing-and-coverage.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10'] + python-version: ['3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d934f55..57acc63 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,6 @@ +fail_fast: true repos: - # Compare the local template version to the latest remote template version - # This hook should always pass. It will print a message if the local version - # is out of date. - - repo: https://github.com/lincc-frameworks/pre-commit-hooks - rev: v0.1 - hooks: - - id: check-lincc-frameworks-template-version - name: Check template version - description: Compare current template version against latest - verbose: true - # Clear output from jupyter notebooks so that only the input cells are committed. - repo: local hooks: @@ -22,21 +12,6 @@ repos: language: system entry: jupyter nbconvert --clear-output - # Run unit tests, verify that they pass. Note that coverage is run against - # the ./src directory here because that is what will be committed. In the - # github workflow script, the coverage is run against the installed package - # and uploaded to Codecov by calling pytest like so: - # `python -m pytest --cov= --cov-report=xml` - - repo: local - hooks: - - id: pytest-check - name: Run unit tests - description: Run unit tests with pytest. - entry: bash -c "if python -m pytest --co -qq; then python -m pytest --cov=./src --cov-report=html; fi" - language: system - pass_filenames: false - always_run: true - # prevents committing directly branches named 'main' and 'master'. - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 @@ -83,4 +58,19 @@ repos: [ "-rn", # Only display messages "-sn", # Don't display the score - ] \ No newline at end of file + ] + + # Run unit tests, verify that they pass. Note that coverage is run against + # the ./src directory here because that is what will be committed. In the + # github workflow script, the coverage is run against the installed package + # and uploaded to Codecov by calling pytest like so: + # `python -m pytest --cov= --cov-report=xml` + - repo: local + hooks: + - id: pytest-check + name: Run unit tests + description: Run unit tests with pytest. + entry: bash -c "if python -m pytest --co -qq; then python -m pytest --cov=./src --cov-report=html; fi" + language: system + pass_filenames: false + always_run: true \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 2ed09f8..3e01102 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,6 @@ [project] name = "pz-rail-som" +requires-python = ">=3.9" license = {file = "LICENSE"} readme = "README.md" authors = [ @@ -42,11 +43,6 @@ build-backend = "setuptools.build_meta" [tool.setuptools_scm] write_to = "src/rail/som/_version.py" -[tools.setuptools.packages.find] -where = ["."] -include = ["rail"] -namespaces = true - [tool.pytest.ini_options] testpaths = [ "tests",