Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up package boilerplate #149

Merged
merged 38 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0babe62
wip
lukasturcani May 28, 2024
30a36d1
Add workflows
lukasturcani May 28, 2024
027703f
wip
lukasturcani May 28, 2024
3959e6a
Add stuff
lukasturcani May 29, 2024
c3b619b
Fix formatting
lukasturcani May 29, 2024
691d3a6
wip
lukasturcani May 29, 2024
8a896ba
wip
lukasturcani May 29, 2024
25d31fe
docs work
lukasturcani May 29, 2024
c02be67
wip
lukasturcani May 29, 2024
d839071
Update checks
lukasturcani May 30, 2024
77c0588
update checks
lukasturcani May 30, 2024
a61fb82
update checks
lukasturcani May 30, 2024
e0b35b2
Add conda
lukasturcani May 30, 2024
1a13431
Thing
lukasturcani May 30, 2024
e8c20f6
Add thing
lukasturcani May 30, 2024
3c6148a
wip
lukasturcani May 30, 2024
5c8be2b
update docs
lukasturcani May 30, 2024
b51ba7d
add link
lukasturcani May 30, 2024
cd892bc
wip
lukasturcani May 30, 2024
fbac1ba
thing
lukasturcani May 30, 2024
0e8bded
wip
lukasturcani May 30, 2024
1cdf89c
remove unnecessary things
lukasturcani May 30, 2024
909f86e
Add back for mypy
lukasturcani May 30, 2024
09dad47
fix long line
lukasturcani Jun 7, 2024
48643bb
Fixes to most ruff linting errors (#2)
jezsadler Aug 20, 2024
54e997c
format
lukasturcani Aug 20, 2024
6669268
Fix docs
lukasturcani Aug 20, 2024
195bb9b
nice
lukasturcani Aug 20, 2024
ecf8e67
wip
lukasturcani Aug 20, 2024
a0ee1ba
update
lukasturcani Aug 20, 2024
39c6608
fix stuff
lukasturcani Aug 20, 2024
756c217
wip
lukasturcani Aug 20, 2024
126595c
wip
lukasturcani Aug 20, 2024
56b8f9a
wip
lukasturcani Aug 20, 2024
d1f9418
fix
lukasturcani Aug 20, 2024
0ca0284
wip
lukasturcani Aug 20, 2024
51a069a
maybe
lukasturcani Aug 20, 2024
ecaac06
nice
lukasturcani Aug 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .coveragerc

This file was deleted.

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
Loading