Skip to content

Commit 1cda625

Browse files
committed
Init
0 parents  commit 1cda625

File tree

12 files changed

+328
-0
lines changed

12 files changed

+328
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
tags:
8+
- '*'
9+
pull_request:
10+
11+
jobs:
12+
linting:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: neuroinformatics-unit/actions/lint@v2
16+
17+
manifest:
18+
name: Check Manifest
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: neuroinformatics-unit/actions/check_manifest@v2
22+
23+
test:
24+
needs: [linting, manifest]
25+
name: ${{ matrix.os }} py${{ matrix.python-version }}
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
matrix:
29+
# Run all supported Python versions on linux
30+
python-version: ["3.9", "3.10", "3.11"]
31+
os: [ubuntu-latest]
32+
# Include one windows and macos run
33+
include:
34+
- os: macos-latest
35+
python-version: "3.10"
36+
- os: windows-latest
37+
python-version: "3.10"
38+
39+
steps:
40+
# Run tests
41+
- uses: neuroinformatics-unit/actions/test@v2
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
45+
build_sdist_wheels:
46+
name: Build source distribution
47+
needs: [test]
48+
if: github.event_name == 'push' && github.ref_type == 'tag'
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: neuroinformatics-unit/actions/build_sdist_wheels@v2
52+
53+
54+
upload_all:
55+
name: Publish build distributions
56+
needs: [build_sdist_wheels]
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: neuroinformatics-unit/actions/upload_pypi@v2
60+
with:
61+
secret-pypi-key: ${{ secrets.TWINE_API_KEY }}

.gitignore

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*,cover
46+
.hypothesis/
47+
48+
# Translations
49+
*.mo
50+
*.pot
51+
52+
# Django stuff:
53+
*.log
54+
local_settings.py
55+
56+
# Flask instance folder
57+
instance/
58+
59+
# Sphinx documentation
60+
docs/_build/
61+
62+
# MkDocs documentation
63+
/site/
64+
65+
# PyBuilder
66+
target/
67+
68+
# Pycharm and VSCode
69+
.idea/
70+
venv/
71+
.vscode/
72+
73+
# IPython Notebook
74+
.ipynb_checkpoints
75+
76+
# pyenv
77+
.python-version
78+
79+
# OS
80+
.DS_Store
81+
82+
# written by setuptools_scm
83+
**/_version.py

.pre-commit-config.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
3+
# Configuring https://pre-commit.ci/
4+
ci:
5+
autoupdate_schedule: monthly
6+
7+
repos:
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v4.4.0
10+
hooks:
11+
- id: check-docstring-first
12+
- id: check-executables-have-shebangs
13+
- id: check-merge-conflict
14+
- id: check-toml
15+
- id: end-of-file-fixer
16+
- id: mixed-line-ending
17+
args: [--fix=lf]
18+
- id: requirements-txt-fixer
19+
- id: trailing-whitespace
20+
- repo: https://github.com/charliermarsh/ruff-pre-commit
21+
rev: v0.0.272
22+
hooks:
23+
- id: ruff
24+
- repo: https://github.com/psf/black
25+
rev: 23.3.0
26+
hooks:
27+
- id: black
28+
- repo: https://github.com/pre-commit/mirrors-mypy
29+
rev: v1.3.0
30+
hooks:
31+
- id: mypy
32+
additional_dependencies:
33+
- types-setuptools
34+
- repo: https://github.com/mgedmin/check-manifest
35+
rev: "0.49"
36+
hooks:
37+
- id: check-manifest
38+
args: [--no-build-isolation]
39+
additional_dependencies: [setuptools-scm]

LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Copyright (c) 2024, Adam Tyson
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
* Neither the name of ethology nor the names of its
16+
contributors may be used to endorse or promote products derived from
17+
this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MANIFEST.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include LICENSE
2+
include README.md
3+
exclude .pre-commit-config.yaml
4+
5+
recursive-exclude * __pycache__
6+
recursive-exclude * *.py[co]
7+
recursive-exclude docs *
8+
recursive-exclude tests *

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# ethology

ethology/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from importlib.metadata import PackageNotFoundError, version
2+
3+
try:
4+
__version__ = version("ethology")
5+
except PackageNotFoundError:
6+
# package is not installed
7+
pass

pyproject.toml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
[project]
2+
name = "ethology"
3+
authors = [{name = "Adam Tyson", email= "code@adamltyson.com"}]
4+
description = "Data processing tools for animal behavioural analysis"
5+
readme = "README.md"
6+
requires-python = ">=3.9.0"
7+
dynamic = ["version"]
8+
9+
license = {text = "BSD-3-Clause"}
10+
11+
classifiers = [
12+
"Development Status :: 2 - Pre-Alpha",
13+
"Programming Language :: Python",
14+
"Programming Language :: Python :: 3",
15+
"Programming Language :: Python :: 3.9",
16+
"Programming Language :: Python :: 3.10",
17+
"Programming Language :: Python :: 3.11",
18+
"Operating System :: OS Independent",
19+
"License :: OSI Approved :: BSD License",
20+
]
21+
22+
[project.urls]
23+
"Homepage" = "https://github.com/neuroinformatics-unit/ethology"
24+
"Bug Tracker" = "https://github.com/neuroinformatics-unit/ethology/issues"
25+
"Documentation" = "https://github.com/neuroinformatics-unit/ethology"
26+
"Source Code" = "https://github.com/neuroinformatics-unit/ethology"
27+
"User Support" = "https://github.com/neuroinformatics-unit/ethology/issues"
28+
29+
[project.optional-dependencies]
30+
dev = [
31+
"pytest",
32+
"pytest-cov",
33+
"coverage",
34+
"tox",
35+
"black",
36+
"mypy",
37+
"pre-commit",
38+
"ruff",
39+
"setuptools_scm",
40+
]
41+
42+
[build-system]
43+
requires = [
44+
"setuptools>=45",
45+
"wheel",
46+
"setuptools_scm[toml]>=6.2",
47+
]
48+
build-backend = "setuptools.build_meta"
49+
50+
[tool.setuptools]
51+
include-package-data = true
52+
53+
[tool.setuptools.packages.find]
54+
include = ["ethology*"]
55+
exclude = ["tests*"]
56+
57+
[tool.pytest.ini_options]
58+
addopts = "--cov=ethology"
59+
60+
[tool.black]
61+
target-version = ['py39', 'py310', 'py311']
62+
skip-string-normalization = false
63+
line-length = 79
64+
65+
[tool.setuptools_scm]
66+
67+
[tool.check-manifest]
68+
ignore = [
69+
".yaml",
70+
"tox.ini",
71+
"tests/",
72+
"tests/test_unit/",
73+
"tests/test_integration/",
74+
]
75+
76+
[tool.ruff]
77+
line-length = 79
78+
exclude = ["__init__.py","build",".eggs"]
79+
select = ["I", "E", "F"]
80+
fix = true
81+
82+
[tool.tox]
83+
legacy_tox_ini = """
84+
[tox]
85+
envlist = py{39,310,311}
86+
isolated_build = True
87+
88+
[gh-actions]
89+
python =
90+
3.9: py39
91+
3.10: py310
92+
3.11: py311
93+
94+
[testenv]
95+
extras =
96+
dev
97+
commands =
98+
pytest -v --color=yes --cov=ethology --cov-report=xml
99+
"""

tests/__init__.py

Whitespace-only changes.

tests/test_integration/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)