Skip to content

Commit

Permalink
Merge pull request #9 from jezsadler/keras3
Browse files Browse the repository at this point in the history
Including CI process changes
  • Loading branch information
jezsadler authored Jun 24, 2024
2 parents bea9863 + 568474a commit f439ffa
Show file tree
Hide file tree
Showing 69 changed files with 1,926 additions and 1,984 deletions.
File renamed without changes.
53 changes: 0 additions & 53 deletions .github/workflows/main.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
publish-release:
runs-on: ubuntu-22.04
env:
VERSION: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- run: pip install -e '.[dev]'
- run: python -m build
- run:
twine upload
-u __token__
-p ${{ secrets.PYPI_API_TOKEN }}
dist/*
82 changes: 82 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
ruff:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- run: pip install '.[dev]'
- run: ruff check src/ tests/ docs/
mypy:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- run: pip install '.[dev]'
- run: mypy src/ tests/ docs/
ruff-format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- run: pip install '.[dev]'
- run: ruff format --check src/ tests/ docs/
pytest:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
- uses: conda-incubator/setup-miniconda@v3
with:
channel-priority: strict
environment-file: environment.yml
use-only-tar-bz2: true
- run: pip install '.[dev]'
- shell: bash -el {0}
run: pytest
- run: python -m coverage xml
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
doctest:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- run: pip install '.[dev]'
- run: make -C docs doctest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
src/omlt/_version.py

# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -50,6 +51,8 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
docs/notebooks/data/MNIST
docs/notebooks/neuralnet/*.keras

# Translations
*.mo
Expand All @@ -70,6 +73,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/_autosummary

# PyBuilder
target/
Expand Down
9 changes: 5 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build:

tools:

python: "3.8"
python: "3.12"

# You can also specify other tool versions:

Expand Down Expand Up @@ -58,7 +58,8 @@ sphinx:
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html

python:

install:

- requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements:
- docs
10 changes: 0 additions & 10 deletions Makefile

This file was deleted.

16 changes: 8 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@ Example
Development
===========

OMLT uses `tox` to manage development tasks:
OMLT uses `just <https://github.com/casey/just>`_ to manage development tasks:

* `tox -av` to list available tasks
* `tox` to run tests
* `tox -e lint` to check formatting and code styles
* `tox -e format` to automatically format files
* `tox -e docs` to build the documentation
* `tox -e publish` to publish the package to PyPi
* ``just`` to list available tasks
* ``just check`` to run all checks
* ``just fix`` to apply any auto-fixes
* ``just dev`` to install development dependencies in your current Python environment
* ``just dev-gpu`` same as ``dev`` but with GPU support
* ``just docs`` to build the documentation

Contributors
============
Expand Down Expand Up @@ -224,4 +224,4 @@ Contributors

.. _zshiqiang: https://github.com/zshiqiang
.. |zshiqiang| image:: https://avatars.githubusercontent.com/u/91337036?v=4
:width: 80px
:width: 80px
15 changes: 3 additions & 12 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
# Makefile for Sphinx documentation
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXOPTS ?= -W --keep-going
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
#AUTODOCDIR = api

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $?), 1)
$(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/")
endif

.PHONY: help clean Makefile

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean:
rm -rf $(BUILDDIR)/* #$(AUTODOCDIR)
.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).
Expand Down
Loading

0 comments on commit f439ffa

Please sign in to comment.