Skip to content

Commit 3e39771

Browse files
authored
Merge pull request #1212 from yambottle/DEV-861-pre-commit
Dev 861 pre commit
2 parents eaa94a4 + 9db9d61 commit 3e39771

File tree

148 files changed

+1734
-1412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+1734
-1412
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ branch = False
33
source = datajoint
44

55
[report]
6-
show_missing = True
6+
show_missing = True

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@
4747
}
4848
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
4949
// "remoteUser": "devcontainer"
50-
}
50+
}

.devcontainer/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ services:
2929

3030
# Overrides default command so things don't shut down after the process ends.
3131
command: /bin/sh -c "while sleep 1000; do :; done"
32-

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ build
33
*.egg-info
44
dist
55
.vscode
6-
__pycache__
6+
__pycache__

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
export UPSTREAM_REPO=https://github.com/${GITHUB_REPOSITORY}.git
1717
export HOST_UID=$(id -u)
1818
docker compose -f docs/docker-compose.yaml up --exit-code-from docs --build
19-
git push origin gh-pages
19+
git push origin gh-pages

.gitignore

Lines changed: 180 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,187 @@
1-
.ipynb_checkpoints/
2-
*.json
3-
*/.*.swp
4-
*/.*.swo
5-
*/*.pyc
6-
.DS_Store
7-
__*__
8-
.idea/
9-
*.pyc
10-
.python-version
11-
*.egg-info/
1+
# https://github.com/github/gitignore/blob/main/Python.gitignore
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
9+
*.so
10+
11+
# Distribution / packaging
12+
.Python
13+
build/
14+
develop-eggs/
1215
dist/
16+
downloads/
17+
eggs/
18+
.eggs/
19+
lib/
20+
lib64/
21+
parts/
22+
sdist/
23+
var/
24+
wheels/
25+
share/python-wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
1329
MANIFEST
14-
.vagrant/
15-
dj_local_conf.json
16-
build/
30+
31+
# PyInstaller
32+
# Usually these files are written by a python script from a template
33+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
34+
*.manifest
35+
*.spec
36+
37+
# Installer logs
38+
pip-log.txt
39+
pip-delete-this-directory.txt
40+
41+
# Unit test / coverage reports
42+
htmlcov/
43+
.tox/
44+
.nox/
1745
.coverage
18-
./tests/.coverage
19-
./tests/dj-store/*
46+
.coverage.*
47+
.cache
48+
nosetests.xml
49+
coverage.xml
50+
*.cover
51+
*.py,cover
52+
.hypothesis/
53+
.pytest_cache/
54+
cover/
55+
56+
# Translations
57+
*.mo
58+
*.pot
59+
60+
# Django stuff:
2061
*.log
21-
*.env
22-
docker-compose.yml
23-
notebook
24-
__main__.py
25-
jupyter_custom.js
26-
.eggs
27-
*.code-workspace
28-
docs/site
62+
local_settings.py
63+
db.sqlite3
64+
db.sqlite3-journal
2965

66+
# Flask stuff:
67+
instance/
68+
.webassets-cache
3069

31-
!.vscode/settings.json
32-
!.vscode/launch.json
33-
!.devcontainer/devcontainer.json
34-
!.devcontainer/docker-compose.yml
70+
# Scrapy stuff:
71+
.scrapy
72+
73+
# Sphinx documentation
74+
docs/_build/
75+
76+
# PyBuilder
77+
.pybuilder/
78+
target/
79+
80+
# Jupyter Notebook
81+
.ipynb_checkpoints
82+
83+
# IPython
84+
profile_default/
85+
ipython_config.py
86+
87+
# pyenv
88+
# For a library or package, you might want to ignore these files since the code is
89+
# intended to run in multiple environments; otherwise, check them in:
90+
.python-version
91+
92+
# pipenv
93+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
95+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
96+
# install all needed dependencies.
97+
#Pipfile.lock
3598

99+
# UV
100+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
101+
# This is especially recommended for binary packages to ensure reproducibility, and is more
102+
# commonly ignored for libraries.
103+
#uv.lock
104+
105+
# poetry
106+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
#poetry.lock
109+
110+
# pdm
111+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112+
#pdm.lock
113+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114+
# in version control.
115+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116+
.pdm.toml
117+
.pdm-python
118+
.pdm-build/
119+
120+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121+
__pypackages__/
122+
123+
# Celery stuff
124+
celerybeat-schedule
125+
celerybeat.pid
126+
127+
# SageMath parsed files
128+
*.sage.py
129+
130+
# Environments
131+
.env
132+
.venv
133+
env/
134+
venv/
135+
ENV/
136+
env.bak/
137+
venv.bak/
138+
139+
# Spyder project settings
140+
.spyderproject
141+
.spyproject
142+
143+
# Rope project settings
144+
.ropeproject
145+
146+
# mkdocs documentation
147+
/site
148+
149+
# mypy
150+
.mypy_cache/
151+
.dmypy.json
152+
dmypy.json
153+
154+
# Pyre type checker
155+
.pyre/
156+
157+
# pytype static type analyzer
158+
.pytype/
159+
160+
# Cython debug symbols
161+
cython_debug/
162+
163+
# PyCharm
164+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166+
# and can be added to the global gitignore or merged into this file. For a more nuclear
167+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168+
.idea/
169+
170+
# VS Code
171+
.vscode/
172+
173+
# Ruff stuff:
174+
.ruff_cache/
175+
176+
# PyPI configuration file
177+
.pypirc
178+
179+
######################
180+
181+
# Mac OS
182+
.DS_Store
183+
184+
# Datajoint related files
185+
dj_local_conf.json
186+
*.env
187+
!.vscode/launch.json

.pre-commit-config.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# pip install datajoint[test]
2+
# pre-commit install
3+
# pre-commit run --all-files
4+
# pre-commit autoupdate
5+
# SKIP=flake8 git commit -m "foo"
6+
7+
# See https://pre-commit.com for more information
8+
# See https://pre-commit.com/hooks.html for more hooks
9+
repos:
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v5.0.0
12+
hooks:
13+
- id: check-yaml
14+
exclude: 'docs/mkdocs.yaml' # exclude mkdocs.yaml since pymdownx.emoji !! usage
15+
- id: check-json
16+
exclude: '(.vscode|.devcontainer)' # exclude these since // was used for comments
17+
- id: check-toml
18+
- id: trailing-whitespace
19+
- id: end-of-file-fixer
20+
- id: check-added-large-files
21+
- repo: https://github.com/codespell-project/codespell
22+
rev: v2.4.1
23+
hooks:
24+
- id: codespell
25+
- repo: https://github.com/pycqa/isort
26+
rev: 5.12.0 # Use the latest stable version
27+
hooks:
28+
- id: isort
29+
args:
30+
- --profile=black # Optional, makes isort compatible with Black
31+
- repo: https://github.com/psf/black
32+
rev: 24.2.0 # matching versions in pyproject.toml and github actions
33+
hooks:
34+
- id: black
35+
args: ["--check", "-v", "datajoint", "tests", "--diff"] # --required-version is conflicting with pre-commit
36+
- repo: https://github.com/PyCQA/flake8
37+
rev: 7.1.2
38+
hooks:
39+
- id: flake8
40+
args:
41+
- --ignore=E203,E722,W503
42+
- --count
43+
- --max-complexity=62
44+
- --max-line-length=127
45+
- --statistics
46+
- --per-file-ignores=datajoint/diagram.py:C901
47+
files: datajoint # a lot of files in tests are not compliant
48+
49+
## Suggest to add pytest hook that runs unit test | Prerequisite: split unit/integration test
50+
## https://github.com/datajoint/datajoint-python/issues/1211

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
"justMyCode": false
1414
}
1515
]
16-
}
16+
}

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
"[dockercompose]": {
1818
"editor.defaultFormatter": "disable"
1919
},
20-
"files.autoSave": "off"
21-
}
20+
//"files.autoSave": "off"
21+
}

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55

66
# Welcome to DataJoint for Python!
77

8-
DataJoint for Python is a framework for scientific workflow management based on
9-
relational principles. DataJoint is built on the foundation of the relational data
10-
model and prescribes a consistent method for organizing, populating, computing, and
8+
DataJoint for Python is a framework for scientific workflow management based on
9+
relational principles. DataJoint is built on the foundation of the relational data
10+
model and prescribes a consistent method for organizing, populating, computing, and
1111
querying data.
1212

13-
DataJoint was initially developed in 2009 by Dimitri Yatsenko in Andreas Tolias' Lab at
14-
Baylor College of Medicine for the distributed processing and management of large
15-
volumes of data streaming from regular experiments. Starting in 2011, DataJoint has
16-
been available as an open-source project adopted by other labs and improved through
13+
DataJoint was initially developed in 2009 by Dimitri Yatsenko in Andreas Tolias' Lab at
14+
Baylor College of Medicine for the distributed processing and management of large
15+
volumes of data streaming from regular experiments. Starting in 2011, DataJoint has
16+
been available as an open-source project adopted by other labs and improved through
1717
contributions from several developers.
18-
Presently, the primary developer of DataJoint open-source software is the company
18+
Presently, the primary developer of DataJoint open-source software is the company
1919
DataJoint (https://datajoint.com).
2020

2121
## Data Pipeline Example

0 commit comments

Comments
 (0)