-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify build system and revert mkdocs (#45)
* Move to hatch * Revert: Move documentation from sphinx to mkdocs
- Loading branch information
Showing
45 changed files
with
764 additions
and
532 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,18 +7,17 @@ on: | |
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
precommit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/[email protected] | ||
|
||
lint: | ||
name: lints | ||
build: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
- precommit | ||
strategy: | ||
matrix: | ||
python-version: [3.11] | ||
|
@@ -30,58 +29,81 @@ jobs: | |
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install tox | ||
- name: Run format, lints and types | ||
pip install hatch | ||
- name: Build package | ||
run: | | ||
tox -e format,lints,types | ||
hatch build | ||
test: | ||
name: unit tests | ||
lints: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
- precommit | ||
strategy: | ||
matrix: | ||
python-version: [3.11] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install tox | ||
- name: Run tests and coverage | ||
run: | | ||
tox -e tests | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
- name: Run codacy-coverage-reporter | ||
uses: codacy/codacy-coverage-reporter-action@v1 | ||
with: | ||
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | ||
coverage-reports: coverage.xml | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install hatch | ||
- name: Run lints | ||
run: | | ||
hatch run test:lints | ||
tests: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- lints | ||
strategy: | ||
matrix: | ||
python-version: [3.11] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install hatch | ||
- name: Build package | ||
run: | | ||
pip install jaxlib==0.4.24 jax==0.4.24 | ||
- name: Run tests | ||
run: | | ||
hatch run test:tests | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
examples: | ||
name: examples | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test | ||
strategy: | ||
matrix: | ||
python-version: [3.11] | ||
steps: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- tests | ||
strategy: | ||
matrix: | ||
python-version: [3.11] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install tox | ||
pip install hatch | ||
- name: Build package | ||
run: | | ||
pip install jaxlib==0.4.24 jax==0.4.24 | ||
- name: Run examples | ||
run: | | ||
tox -e examples | ||
hatch run test:examples | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
PKG_VERSION=`python setup.py --version` | ||
.PHONY: tag, tests, lints, docs, format, examples | ||
|
||
PKG_VERSION=`hatch version` | ||
|
||
tag: | ||
git tag -a "v$(PKG_VERSION)" -m "v$(PKG_VERSION)" | ||
git push --tag | ||
git tag -a v${PKG_VERSION} -m v${PKG_VERSION} | ||
git push --tag | ||
|
||
tests: | ||
hatch run test:tests | ||
|
||
lints: | ||
hatch run test:lints | ||
|
||
format: | ||
hatch run test:format | ||
|
||
docs: | ||
cd docs && make html | ||
|
||
examples: | ||
hatch run test:examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Minimal makefile for Sphinx documentation | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = ./ | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
rm -rf build | ||
rm -rf source/examples | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from pygments.style import Style | ||
from pygments.token import Error, Text, Whitespace, Other | ||
|
||
|
||
class MyStyle(Style): | ||
background_color = "black" | ||
highlight_color = "#49483e" | ||
|
||
styles = { | ||
Text: "#f8f8f2", # class: '' | ||
Whitespace: "", # class: 'w' | ||
Error: "#960050 bg:#1e0010", # class: 'err' | ||
Other: "", # class 'x' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,79 @@ | ||
:root { | ||
--md-primary-fg-color: #b26679; | ||
--md-primary-bg-color: #ffe9dd; | ||
--pst-color-secondary: rgb(121, 40, 161); | ||
--pst-color-inline-code-links: rgb(121, 40, 161); | ||
--md-accent-fg-color: rgb(121, 40, 161); | ||
html[data-theme="light"] { | ||
--pst-color-primary: rgb(121, 40, 161); | ||
--pst-color-secondary: #b26679; | ||
--pst-color-inline-code-links: #b26679; | ||
} | ||
|
||
html { | ||
font-size: 130%; | ||
pre > span { | ||
line-height: 20px; | ||
} | ||
|
||
span.kn { | ||
color: rgb(0, 120, 161) !important; | ||
} | ||
|
||
span.ml, span.mi, span.nb { | ||
color: lightcoral !important; | ||
} | ||
|
||
span.k, span.nn { | ||
color: rgb(168, 70, 185) !important; | ||
} | ||
|
||
h1 > code > span { | ||
font-weight: 700 !important; | ||
} | ||
|
||
pre { | ||
border: 0; | ||
font-size: 13px; | ||
background-color: rgb(245, 245, 245) !important; | ||
} | ||
|
||
h1 { | ||
margin-bottom: 50px; | ||
} | ||
h3, h2, h1 { | ||
font-weight: 300 !important; | ||
} | ||
|
||
nav > li > a > code.literal { | ||
padding-top: 0; | ||
padding-bottom: 0; | ||
background-color: white; | ||
border: 0; | ||
} | ||
|
||
nav.bd-links p.caption { | ||
text-transform: uppercase; | ||
} | ||
|
||
code.literal { | ||
background-color: white; | ||
border: 0; | ||
border-radius: 0; | ||
} | ||
|
||
a > code { | ||
font-weight: 575; | ||
} | ||
|
||
a:hover { | ||
text-decoration-thickness: 1px !important; | ||
} | ||
|
||
ul.bd-breadcrumbs li.breadcrumb-item a:hover { | ||
text-decoration-thickness: 1px; | ||
} | ||
|
||
nav.bd-links li > a:hover { | ||
text-decoration-thickness: 1px; | ||
} | ||
|
||
.prev-next-area a p.prev-next-title { | ||
text-decoration: none !important; | ||
} | ||
|
||
button.theme-switch-button { | ||
display: none !important; | ||
} |
Oops, something went wrong.