Skip to content

Commit

Permalink
✨ Modernise repository (#16)
Browse files Browse the repository at this point in the history
- ruff linting/formatting
- poetry -> flit + tox-uv
- Fix sphinx deprecation warnings (update CSS/JS instillation)
- Add logger warnings for non-html builders
- Add tests
- Add GH action CI
- Use furo docs theme (remove all the ubdocs stuff)
- update version to 0.2.0 (ready for release)
  • Loading branch information
chrisjsewell authored Aug 28, 2024
1 parent 7769ddc commit 5670ac8
Show file tree
Hide file tree
Showing 35 changed files with 531 additions and 1,277 deletions.
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: github-actions
directory: /
commit-message:
prefix: 🔧
schedule:
interval: monthly
- package-ecosystem: pip
directory: /
commit-message:
prefix: ⬆️
schedule:
interval: monthly
66 changes: 66 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI
on:
push:
branches: [main]
pull_request:
jobs:

lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: '3.8'
- uses: pre-commit/[email protected]

tests:
name: "Core py${{ matrix.python-version }} sphinx~=${{ matrix.sphinx-version }} ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # Set on "false" to get the results of ALL builds
matrix:
os: ["ubuntu-latest"]
# 3.9.8 seems to be broken with type_ast
# https://www.mail-archive.com/[email protected]/msg1829077.html
python-version: ["3.8", "3.11"]
sphinx-version: ["6.0", "7.0", "8.0"]
include:
- os: "windows-latest"
python-version: "3.8"
sphinx-version: "6.0"
steps:
- uses: actions/checkout@v4
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: |
python -m pip install sphinx~=${{ matrix.sphinx-version }} -e .[test]
python -m pip freeze
- name: Run pytest
run: python -m pytest -v --cov=src --cov-report=xml --cov-report=term-missing tests

check:

# This job does nothing and is only used for the branch protection
# see https://github.com/marketplace/actions/alls-green#why

if: always()

needs:
- lint
- tests

runs-on: ubuntu-latest

steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ _build
.doctrees
docs/github_images/
.eggs/
docs/_images/need_pie_*.png
.ruff_cache

.devcontainer/
.vscode/
Expand Down
25 changes: 5 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
repos:
- repo: https://github.com/psf/black
rev: 24.1.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.1
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-simplify
- pep8-naming

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args:
- --py36-plus
- id: ruff
args: [--fix]
- id: ruff-format
3 changes: 2 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ build:

sphinx:
configuration: docs/conf.py
builder: html
fail_on_warning: true

python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements:
Expand Down
14 changes: 4 additions & 10 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
/* Data viewer */
.json-container .json-key {
color: var(--md-code-fg-color);
color: var(--color-foreground-primary);
}

.json-container .json-size {
color: var(--md-code-hl-number-color);
color: var(--color-foreground-muted);
}

.sd-card {
border: 1px solid var(--md-typeset-color);
table.need {
background-color: transparent;
}
.border {
border: 1px solid var(--md-typeset-color);
}
.sd-card-header {
border-bottom: 1px solid var(--md-typeset-color);
}
143 changes: 143 additions & 0 deletions docs/_static/sphinx-data-viewer-logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5670ac8

Please sign in to comment.