-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 28c09f1
Showing
12 changed files
with
345 additions
and
0 deletions.
There are no files selected for viewing
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,61 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
tags: | ||
- '*' | ||
pull_request: | ||
|
||
jobs: | ||
linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: neuroinformatics-unit/actions/lint@v2 | ||
|
||
manifest: | ||
name: Check Manifest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: neuroinformatics-unit/actions/check_manifest@v2 | ||
|
||
test: | ||
needs: [linting, manifest] | ||
name: ${{ matrix.os }} py${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
# Run all supported Python versions on linux | ||
python-version: ["3.9", "3.10", "3.11"] | ||
os: [ubuntu-latest] | ||
# Include one windows and macos run | ||
include: | ||
- os: macos-latest | ||
python-version: "3.10" | ||
- os: windows-latest | ||
python-version: "3.10" | ||
|
||
steps: | ||
# Run tests | ||
- uses: neuroinformatics-unit/actions/test@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
build_sdist_wheels: | ||
name: Build source distribution | ||
needs: [test] | ||
if: github.event_name == 'push' && github.ref_type == 'tag' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: neuroinformatics-unit/actions/build_sdist_wheels@v2 | ||
|
||
|
||
upload_all: | ||
name: Publish build distributions | ||
needs: [build_sdist_wheels] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: neuroinformatics-unit/actions/upload_pypi@v2 | ||
with: | ||
secret-pypi-key: ${{ secrets.TWINE_API_KEY }} |
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,83 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
|
||
# Flask instance folder | ||
instance/ | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# MkDocs documentation | ||
/site/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Pycharm and VSCode | ||
.idea/ | ||
venv/ | ||
.vscode/ | ||
|
||
# IPython Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# OS | ||
.DS_Store | ||
|
||
# written by setuptools_scm | ||
**/_version.py |
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,45 @@ | ||
|
||
|
||
# Configuring https://pre-commit.ci/ | ||
ci: | ||
autoupdate_schedule: monthly | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-docstring-first | ||
- id: check-executables-have-shebangs | ||
- id: check-merge-conflict | ||
- id: check-toml | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
args: [--fix=lf] | ||
- id: requirements-txt-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.8.1 | ||
hooks: | ||
- id: ruff | ||
args: [ --config=pyproject.toml ] | ||
- id: ruff-format | ||
args: [ --config=pyproject.toml ] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.13.0 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: | ||
- types-setuptools | ||
- repo: https://github.com/mgedmin/check-manifest | ||
rev: "0.50" | ||
hooks: | ||
- id: check-manifest | ||
args: [--no-build-isolation] | ||
additional_dependencies: [setuptools-scm, wheel] | ||
- repo: https://github.com/codespell-project/codespell | ||
# Configuration for codespell is in pyproject.toml | ||
rev: v2.3.0 | ||
hooks: | ||
- id: codespell | ||
additional_dependencies: | ||
- tomli |
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,22 @@ | ||
|
||
The MIT License (MIT) | ||
|
||
Copyright (c) 2024 Matt Whiteway | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
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,8 @@ | ||
include LICENSE | ||
include README.md | ||
exclude .pre-commit-config.yaml | ||
|
||
recursive-exclude * __pycache__ | ||
recursive-exclude * *.py[co] | ||
recursive-exclude docs * | ||
recursive-exclude tests * |
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 @@ | ||
# lp3d-analysis |
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,7 @@ | ||
from importlib.metadata import PackageNotFoundError, version | ||
|
||
try: | ||
__version__ = version("lp3d-analysis") | ||
except PackageNotFoundError: | ||
# package is not installed | ||
pass |
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,116 @@ | ||
[project] | ||
name = "lp3d-analysis" | ||
authors = [{name = "Matt Whiteway", email= "m.whiteway@columbia.edu"}] | ||
description = "Analysis tools for multiview pose estimation models" | ||
readme = "README.md" | ||
requires-python = ">=3.9.0" | ||
dynamic = ["version"] | ||
|
||
dependencies = [] | ||
|
||
license = {text = "MIT"} | ||
|
||
classifiers = [ | ||
"Development Status :: 2 - Pre-Alpha", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Operating System :: OS Independent", | ||
"License :: OSI Approved :: MIT License", | ||
] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/paninski-lab/lp3d-analysis" | ||
"Bug Tracker" = "https://github.com/paninski-lab/lp3d-analysis/issues" | ||
"Documentation" = "https://github.com/paninski-lab/lp3d-analysis" | ||
"Source Code" = "https://github.com/paninski-lab/lp3d-analysis" | ||
"User Support" = "https://github.com/paninski-lab/lp3d-analysis/issues" | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"pytest", | ||
"pytest-cov", | ||
"coverage", | ||
"tox", | ||
"mypy", | ||
"pre-commit", | ||
"ruff", | ||
"setuptools_scm", | ||
] | ||
|
||
[build-system] | ||
requires = [ | ||
"setuptools>=45", | ||
"wheel", | ||
"setuptools_scm[toml]>=6.2", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["lp3d_analysis*"] | ||
exclude = ["tests*"] | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--cov=lp3d_analysis" | ||
filterwarnings = [ | ||
"error", | ||
] | ||
|
||
[tool.setuptools_scm] | ||
|
||
[tool.check-manifest] | ||
ignore = [ | ||
".yaml", | ||
"tox.ini", | ||
"tests/", | ||
"tests/test_unit/", | ||
"tests/test_integration/", | ||
] | ||
|
||
[tool.ruff] | ||
line-length = 79 | ||
exclude = ["__init__.py", "build", ".eggs"] | ||
lint.select = [ | ||
"E", # pycodestyle errors | ||
"F", # Pyflakes | ||
"I", # isort | ||
# You can see what all the rules do here: https://docs.astral.sh/ruff/rules/ | ||
# Some additional ruff rules that might be useful (uncomment to enable) | ||
#"UP", # pyupgrade | ||
#"B", # flake8 bugbear | ||
#"SIM", # flake8 simplify | ||
#"C90", # McCabe complexity | ||
] | ||
fix = true | ||
|
||
[tool.ruff.format] | ||
docstring-code-format = true # Also format code in docstrings (e.g. examples) | ||
|
||
[tool.tox] | ||
legacy_tox_ini = """ | ||
[tox] | ||
envlist = py{39,310,311} | ||
isolated_build = True | ||
[gh-actions] | ||
python = | ||
3.9: py39 | ||
3.10: py310 | ||
3.11: py311 | ||
[testenv] | ||
extras = | ||
dev | ||
commands = | ||
pytest -v --color=yes --cov=lp3d_analysis --cov-report=xml | ||
""" | ||
|
||
|
||
[tool.codespell] | ||
skip = '.git' | ||
check-hidden = true |
Empty file.
Empty file.
Empty file.
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,2 @@ | ||
def test_placeholder(): | ||
assert True |