Skip to content

Commit

Permalink
Update target_selection build, linting, and formatting (#454)
Browse files Browse the repository at this point in the history
* Replace setup.py with pyproject.tom with poetry backend

* Remove flake8 linting configuration

* Update RTD config

* Add workflows for linting and releasing

* Remove bin/target_selection

* Use sdsstools.yanny for yanny_scraper

* Add test workflow

* Update sdsstools to 0.12.0 and click to 8.x

* Apply ruff format to all files

* Basic import testing

* Fix Sphinx conf.py

* Remove pep_440=True from get_package_version in __init__.py

* Use language "en" as default for the documentation

* name should be "sdss-target-selection"

* Update CHANGELOG

* Add check-lockfile workflow

* Update README.md

* Add note about updating package version
  • Loading branch information
albireox authored Jul 4, 2024
1 parent 9ec4556 commit 32a5663
Show file tree
Hide file tree
Showing 67 changed files with 13,104 additions and 8,537 deletions.
19 changes: 0 additions & 19 deletions .flake8

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/check-lockfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check lockfile

on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'

jobs:
check-lockfile:
runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install poetry
run: |
pipx install poetry
- name: Check lockfile
run: |
poetry check --lock
33 changes: 33 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Linting

on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'

jobs:
lint:
runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Lint with ruff
run: |
pip install ruff
ruff check python/target_selection
ruff format --check python/target_selection
41 changes: 0 additions & 41 deletions .github/workflows/pythonapp.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Create Release

on:
push:
tags:
- '*'

jobs:
release:
name: Build wheels
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.12']

permissions:
contents: write
id-token: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create release
uses: softprops/action-gh-release@v2
with:
name: target_selection ${{ github.ref_name }}

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel build
- name: Build wheels
run: |
pyproject-build -w
- name: Build source
run: |
pyproject-build -s
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test

on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
pip install --upgrade wheel pip setuptools
pip install .
- name: Test with pytest
run: |
pip install pytest pytest-mock pytest-cov
pytest tests/
Loading

0 comments on commit 32a5663

Please sign in to comment.