Skip to content

Commit

Permalink
Apply PPT v1.5.2 (#213)
Browse files Browse the repository at this point in the history
* Copier re-copy

* Fix pyproject.
  • Loading branch information
delucchi-cmu authored Feb 15, 2024
1 parent 745f38b commit ae1e1c1
Show file tree
Hide file tree
Showing 14 changed files with 127 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v1.5.0
_commit: v1.5.2
_src_path: gh:lincc-frameworks/python-project-template
author_email: [email protected]
author_name: LINCC Frameworks
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/asv-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:

steps:
- name: Cache Python ${{ env.PYTHON_VERSION }}
uses: actions/cache@main
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-${{ env.PYTHON_VERSION }}

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@main
uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"

Expand All @@ -46,12 +46,12 @@ jobs:

steps:
- name: Checkout main branch of the repository
uses: actions/checkout@main
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache Python ${{ env.PYTHON_VERSION }}
uses: actions/cache@main
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-${{ env.PYTHON_VERSION }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/asv-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ jobs:

steps:
- name: Checkout main branch of the repository
uses: actions/checkout@main
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache Python ${{ env.PYTHON_VERSION }}
uses: actions/cache@main
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-${{ env.PYTHON_VERSION }}

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@main
uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"

Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Use last nightly commit hash from cache
uses: actions/cache@main
uses: actions/cache@v4
with:
path: ${{ env.WORKING_DIR }}
key: nightly-results-${{ steps.nightly-dates.outputs.yesterday }}
Expand All @@ -87,7 +87,7 @@ jobs:
echo $CURRENT_HASH > $HASH_FILE
- name: Update last nightly hash in cache
uses: actions/cache@main
uses: actions/cache@v4
with:
path: ${{ env.WORKING_DIR }}
key: nightly-results-${{ steps.nightly-dates.outputs.today }}
12 changes: 6 additions & 6 deletions .github/workflows/asv-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cache Python ${{ env.PYTHON_VERSION }}
uses: actions/cache@main
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-${{ env.PYTHON_VERSION }}
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@main
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
asv-pr:
Expand All @@ -40,14 +40,14 @@ jobs:
working-directory: ${{ env.WORKING_DIR }}
steps:
- name: Checkout PR branch of the repository
uses: actions/checkout@main
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Display Workflow Run Information
run: |
echo "Workflow Run ID: ${{ github.run_id }}"
- name: Cache Python ${{ env.PYTHON_VERSION }}
uses: actions/cache@main
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-${{ env.PYTHON_VERSION }}
Expand All @@ -61,7 +61,7 @@ jobs:
- name: Save pull request number
run: echo ${{ github.event.pull_request.number }} > ${{ env.ARTIFACTS_DIR }}/pr
- name: Get current job logs URL
uses: Tiryoh/gha-jobid-action@main
uses: Tiryoh/gha-jobid-action@v1
id: jobs
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -80,7 +80,7 @@ jobs:
env:
STEP_URL: "${{ steps.jobs.outputs.html_url }}#step:11:1"
- name: Upload artifacts (PR number and benchmarks output)
uses: actions/upload-artifact@main
uses: actions/upload-artifact@v4
with:
name: benchmark-artifacts
path: ${{ env.ARTIFACTS_DIR }}
4 changes: 2 additions & 2 deletions .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@main
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@main
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
python-version: ['3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@main
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pre-commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
env:
SKIP: "check-lincc-frameworks-template-version,pytest-check,no-commit-to-branch,validate-pyproject,check-added-large-files,sphinx-build"
steps:
- uses: actions/checkout@main
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@main
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
Expand All @@ -26,8 +26,8 @@ jobs:
python -m pip install --upgrade pip
pip install .[dev]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- uses: pre-commit/action@main # Still using Node 16
- uses: pre-commit/action@v3.0.1
with:
extra_args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
- uses: pre-commit-ci/lite-action@main
- uses: pre-commit-ci/lite-action@v1.0.2
if: always()
6 changes: 3 additions & 3 deletions .github/workflows/publish-benchmarks-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
echo "Conclusion: ${{ github.event.workflow_run.conclusion }}"
echo "Event: ${{ github.event.workflow_run.event }}"
- name: Download artifact
uses: dawidd6/action-download-artifact@master
uses: dawidd6/action-download-artifact@v3
with:
name: benchmark-artifacts
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -38,14 +38,14 @@ jobs:
printf "Output:\n$(cat output)"
printf "pr=$(cat pr)" >> $GITHUB_OUTPUT
- name: Find benchmarks comment
uses: peter-evans/find-comment@main
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ steps.pr-info.outputs.pr }}
comment-author: 'github-actions[bot]'
body-includes: view all benchmarks
- name: Create or update benchmarks comment
uses: peter-evans/create-or-update-comment@main
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ steps.pr-info.outputs.pr }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/checkout@main
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@main
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
python-version: ['3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@main
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -43,7 +43,7 @@ jobs:
- name: Send status to Slack app
if: ${{ failure() && github.event_name != 'workflow_dispatch' }} # Only post if the workflow failed and was not manually started. Customize this as necessary.
id: slack
uses: slackapi/slack-github-action@main
uses: slackapi/slack-github-action@v1
with:
# For posting a rich message using Block Kit
payload: | # The payload defined here can be customized to you liking https://api.slack.com/reference/block-kit/blocks
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/testing-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
python-version: ['3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@main
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -33,6 +33,6 @@ jobs:
run: |
python -m pytest --cov=hipscat --cov-report=xml
- name: Upload coverage report to codecov
uses: codecov/codecov-action@main
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,6 @@ tmp/
# Airspeed Velocity performance results
_results/
_html/

# Project initialization script
.initialize_new_project.sh
41 changes: 41 additions & 0 deletions .setup_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

# This script should be run by new developers to install this package in
# editable mode and configure their local environment

echo "Checking virtual environment"
if [ -z "${VIRTUAL_ENV}" ] && [ -z "${CONDA_PREFIX}" ]; then
echo 'No virtual environment detected: none of $VIRTUAL_ENV or $CONDA_PREFIX is set.'
echo
echo "=== This script is going to install the project in the system python environment ==="
echo "Proceed? [y/N]"
read -r RESPONCE
if [ "${RESPONCE}" != "y" ]; then
echo "See https://lincc-ppt.readthedocs.io/ for details."
echo "Exiting."
exit 1
fi

fi

echo "Checking pip version"
MINIMUM_PIP_VERSION=22
pipversion=( $(python -m pip --version | awk '{print $2}' | sed 's/\./ /g') )
if let "${pipversion[0]}<${MINIMUM_PIP_VERSION}"; then
echo "Insufficient version of pip found. Requires at least version ${MINIMUM_PIP_VERSION}."
echo "See https://lincc-ppt.readthedocs.io/ for details."
exit 1
fi

echo "Installing package and runtime dependencies in local environment"
python -m pip install -e . > /dev/null

echo "Installing developer dependencies in local environment"
python -m pip install -e .'[dev]' > /dev/null

echo "Installing pre-commit"
pre-commit install > /dev/null

#######################################################
# Include any additional configurations below this line
#######################################################
51 changes: 48 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
# On a mac, install optional dependencies with `pip install '.[dev]'` (include the single quotes)
[project.optional-dependencies]
dev = [
"adlfs", # abfs filesytem support
"adlfs", # abfs filesytem support
"asv==0.6.1", # Used to compute performance benchmarks
"black", # auto-formatter
"ipykernel", # Support for Jupyter notebooks
Expand All @@ -50,9 +50,9 @@ dev = [
"pytest-timeout", # Used to test for code efficiency
"s3fs", # s3 filesystem support
"sphinx", # Used to automatically generate documentation
"sphinx-autoapi", # Used to automatically generate api documentation
"sphinx-autoapi", # Used to automatically generate api documentation
"sphinx-rtd-theme" # Used to render documentation
]
]

[build-system]
requires = [
Expand Down Expand Up @@ -80,3 +80,48 @@ target-version = ["py38"]
[tool.isort]
profile = "black"
line_length = 110

[tool.ruff]
line-length = 110
target-version = "py39"

[tool.ruff.lint]
select = [
# pycodestyle
"E",
"W",
# Pyflakes
"F",
# pep8-naming
"N",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
# docstrings
"D101",
"D102",
"D103",
"D106",
"D206",
"D207",
"D208",
"D300",
"D417",
"D419",

]

ignore = [
"UP006", # Allow non standard library generics in type hints
"UP007", # Allow Union in type hints
"SIM114", # Allow if with same arms
"B028", # Allow default warning level
"SIM117", # Allow nested with
"UP015", # Allow redundant open parameters
"UP028", # Allow yield in for loop
]

0 comments on commit ae1e1c1

Please sign in to comment.