Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
squarebot[bot] committed Feb 10, 2025
0 parents commit 91b8424
Show file tree
Hide file tree
Showing 31 changed files with 1,232 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODE_OF_CONDUCT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please see the [Team Culture and Conduct Standards](https://developer.lsst.io/team/code-of-conduct.html) for LSST Data Management.
16 changes: 16 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Thanks for contributing to rubin_rag.

## Support

If you are a Rubin Observatory staff member, please reach out of us on Slack in the #dm-square channel or create a Jira ticket.

If you are a community member, feel free to create a GitHub issue and we'll do our best to help you.

## Pull requests

Since rubin_rag is built for the Vera C. Rubin Observatory and Legacy Survey of Space and Time, community contributions can only be accepted if they align with the Rubin Observatory's mission.
For that reason, it's a good idea to propose changes with a new GitHub issue before investing time in making a pull request.

* * *

See also our [Code of Conduct](./CODE_OF_CONDUCT).
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
144 changes: 144 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: Python CI

env:
# Default Python version used for all jobs other than test, which uses a
# matrix of supported versions. Quote the version to avoid interpretation as
# a floating point number.
PYTHON_VERSION: "3.12"

"on":
merge_group: {}
pull_request: {}
push:
branches-ignore:
# These should always correspond to pull requests, so ignore them for
# the push trigger and let them be triggered by the pull_request
# trigger, avoiding running the workflow twice. This is a minor
# optimization so there's no need to ensure this is comprehensive.
- "dependabot/**"
- "gh-readonly-queue/**"
- "renovate/**"
- "tickets/**"
- "u/**"
release:
types: [published]

jobs:
lint:

runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v4

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

- name: Run pre-commit
uses: pre-commit/[email protected]

test:

runs-on: ubuntu-latest
timeout-minutes: 10

strategy:
matrix:
python:
- "3.12"

steps:
- uses: actions/checkout@v4

- name: Run tox
uses: lsst-sqre/run-tox@v1
with:
python-version: ${{ matrix.python }}
tox-envs: "py,typing"
tox-plugins: tox-uv

docs:

runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for setuptools_scm

- name: Install Graphviz
run: sudo apt-get install graphviz

- name: Run tox
uses: lsst-sqre/run-tox@v1
with:
python-version: ${{ env.PYTHON_VERSION }}
tox-envs: "docs"
# Add docs-linkcheck when the docs and PyPI package are published
# tox-envs: "docs,docs-linkcheck"
tox-plugins: tox-uv

# Only attempt documentation uploads for tagged releases and pull
# requests from ticket branches in the same repository. This avoids
# version clutter in the docs and failures when a PR doesn't have access
# to secrets.
- name: Upload to LSST the Docs
uses: lsst-sqre/ltd-upload@v1
with:
project: "rubin_rag"
dir: "docs/_build/html"
username: ${{ secrets.LTD_USERNAME }}
password: ${{ secrets.LTD_PASSWORD }}
if: >
github.event_name != 'merge_group'
&& (github.event_name != 'pull_request'
|| startsWith(github.head_ref, 'tickets/'))
test-packaging:

name: Test packaging
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [lint, test, docs]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for setuptools_scm

- name: Build and publish
uses: lsst-sqre/build-and-publish-to-pypi@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
upload: false

pypi:

# This job requires set up:
# 1. Set up a trusted publisher for PyPI
# 2. Set up a "pypi" environment in the repository
# See https://github.com/lsst-sqre/build-and-publish-to-pypi
name: Upload release to PyPI
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [lint, test, docs, test-packaging]
environment:
name: pypi
url: https://pypi.org/p/rubin_rag
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for setuptools_scm

- name: Build and publish
uses: lsst-sqre/build-and-publish-to-pypi@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
76 changes: 76 additions & 0 deletions .github/workflows/periodic-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# This is a separate run of the Python test suite that doesn't cache the tox
# environment and runs from a schedule. The purpose is to test compatibility
# with the latest versions of dependencies.

name: Periodic CI

env:
# Default Python version used for all jobs other than test, which uses a
# matrix of supported versions. Quote the version to avoid interpretation as
# a floating point number.
PYTHON_VERSION: "3.12"

"on":
schedule:
- cron: "0 12 * * 1"
workflow_dispatch: {}

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10

strategy:
matrix:
python:
- "3.12"

steps:
- uses: actions/checkout@v4

- name: Run tests in tox
uses: lsst-sqre/run-tox@v1
with:
python-version: ${{ matrix.python }}
tox-envs: "lint,typing,py"
tox-plugins: tox-uv
use-cache: false


docs:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for setuptools_scm

- name: Install Graphviz
run: sudo apt-get install graphviz

- name: Build docs in tox
uses: lsst-sqre/run-tox@v1
with:
python-version: ${{ env.PYTHON_VERSION }}
tox-envs: "docs,docs-linkcheck"
tox-plugins: tox-uv
use-cache: false


test-packaging:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [test, docs]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for setuptools_scm

- name: Build and publish
uses: lsst-sqre/build-and-publish-to-pypi@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
upload: false

130 changes: 130 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
docs/api/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
Loading

0 comments on commit 91b8424

Please sign in to comment.