Skip to content

Commit 5bb7c86

Browse files
Adding project structure
1 parent 92f6e8a commit 5bb7c86

8 files changed

+487
-10
lines changed

.gitignore

+162
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
__pycache__/
2+
*.pyc
3+
*.swp
4+
*.pyc
5+
**/*.pyc
6+
*.pdf
7+
exp*.py
8+
*.sh
9+
dev/
10+
dataset/
11+
template
12+
lib_res/
13+
venv/
14+
env/
15+
.idea/
16+
Scalpel.egg-info/
17+
wiki-pages/
18+
# Byte-compiled / optimized / DLL files
19+
__pycache__/
20+
*.py[cod]
21+
*$py.class
22+
23+
# C extensions
24+
*.so
25+
26+
# Distribution / packaging
27+
.Python
28+
build/
29+
develop-eggs/
30+
dist/
31+
downloads/
32+
eggs/
33+
.eggs/
34+
lib/
35+
lib64/
36+
parts/
37+
sdist/
38+
var/
39+
wheels/
40+
pip-wheel-metadata/
41+
share/python-wheels/
42+
*.egg-info/
43+
.installed.cfg
44+
*.egg
45+
MANIFEST
46+
47+
# PyInstaller
48+
# Usually these files are written by a python script from a template
49+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
50+
*.manifest
51+
*.spec
52+
53+
# Installer logs
54+
pip-log.txt
55+
pip-delete-this-directory.txt
56+
57+
# Unit test / coverage reports
58+
htmlcov/
59+
.tox/
60+
.nox/
61+
.coverage
62+
.coverage.*
63+
.cache
64+
nosetests.xml
65+
coverage.xml
66+
*.cover
67+
*.py,cover
68+
.hypothesis/
69+
.pytest_cache/
70+
71+
# Translations
72+
*.mo
73+
*.pot
74+
75+
# Django stuff:
76+
*.log
77+
local_settings.py
78+
db.sqlite3
79+
db.sqlite3-journal
80+
81+
# Flask stuff:
82+
instance/
83+
.webassets-cache
84+
85+
# Scrapy stuff:
86+
.scrapy
87+
88+
# Sphinx documentation
89+
docs/_build/
90+
91+
# PyBuilder
92+
target/
93+
94+
# Jupyter Notebook
95+
.ipynb_checkpoints
96+
97+
# IPython
98+
profile_default/
99+
ipython_config.py
100+
101+
# pyenv
102+
.python-version
103+
104+
# pipenv
105+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
106+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
107+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
108+
# install all needed dependencies.
109+
#Pipfile.lock
110+
111+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
112+
__pypackages__/
113+
114+
# Celery stuff
115+
celerybeat-schedule
116+
celerybeat.pid
117+
118+
# SageMath parsed files
119+
*.sage.py
120+
121+
# Environments
122+
.env
123+
.venv
124+
env/
125+
venv/
126+
ENV/
127+
env.bak/
128+
venv.bak/
129+
130+
# Spyder project settings
131+
.spyderproject
132+
.spyproject
133+
134+
# Rope project settings
135+
.ropeproject
136+
137+
# mkdocs documentation
138+
/site
139+
140+
# mypy
141+
.mypy_cache/
142+
.dmypy.json
143+
dmypy.json
144+
145+
# Pyre type checker
146+
.pyre/
147+
148+
# Vim backup
149+
*.un~
150+
151+
### VisualStudioCode ###
152+
.vscode/* # Maybe .vscode/**/* instead - see comments
153+
!.vscode/settings.json
154+
!.vscode/tasks.json
155+
!.vscode/launch.json
156+
!.vscode/extensions.json
157+
158+
### VisualStudioCode Patch ###
159+
# Ignore all local history of files
160+
**/.history
161+
162+
!setup.sh

.pre-commit-config.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
default_language_version:
4+
python: python3.10
5+
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v4.4.0
8+
hooks:
9+
- id: check-added-large-files
10+
- id: check-toml
11+
- id: check-yaml
12+
args:
13+
- --unsafe
14+
- id: end-of-file-fixer
15+
- id: trailing-whitespace
16+
- repo: https://github.com/charliermarsh/ruff-pre-commit
17+
rev: v0.0.254
18+
hooks:
19+
- id: ruff
20+
args:
21+
- --exit-zero
22+
# - --exclude
23+
# - examples/*
24+
25+
- repo: https://github.com/pycqa/isort
26+
rev: 5.12.0
27+
hooks:
28+
- id: isort
29+
name: isort (python)
30+
- id: isort
31+
name: isort (cython)
32+
types: [cython]
33+
- id: isort
34+
name: isort (pyi)
35+
types: [pyi]
36+
- repo: https://github.com/psf/black
37+
rev: 23.1.0
38+
hooks:
39+
- id: black
40+
ci:
41+
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
42+
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate

.vscode/settings.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"[python]": {
3+
"editor.defaultFormatter": "ms-python.black-formatter",
4+
"editor.formatOnSave": true
5+
}
6+
}

Makefile

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Lint code using ruff
2+
.PHONY: lint
3+
lint:
4+
@echo "\n################\n Running ruff \n################\n"
5+
python -m ruff --version
6+
python -m ruff scalpel --exit-zero
7+
@echo "\n################\n Running isort \n################\n"
8+
python -m isort scalpel
9+
10+
## Format code using black
11+
.PHONY: black
12+
black:
13+
@echo "\n################\n Running black \n################\n"
14+
python -m black --version
15+
python -m black scalpel
16+
17+
## Run tests using pytest
18+
.PHONY: pytest
19+
pytest:
20+
@echo "\n################\n Running tests (pytest) \n################\n"
21+
python -m pytest --version
22+
# python -m pytest tests
23+
24+
## Run all tests
25+
.PHONY: test
26+
test: pytest
27+
28+
## Run all
29+
.PHONY: all
30+
all: lint black test

README.md

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
# Master/Bachelor Thesis of |STUDENT NAME|
2-
3-
- Please use this repository to store all your thesis related files. This includes your proposal document, presentation, code, thesis document, etc.
1+
# TypeEvalPy
42

5-
- It is suggested to keep this repository up to date and commit your changes before your meetings with the supervisor.
3+
## Setup Environment
64

7-
- Please avoid from committing huge files, for instance, a large dataset. Rather, upload it elsewhere and link it.
8-
9-
- The proposal is typically the starting point for your thesis, please find some examples in the `proposal` folder. It also contains a LaTex template you should use to write your proposal.
10-
----
11-
12-
Make sure you have understood the process of working on a thesis with our group by visiting the following link: https://www.hni.uni-paderborn.de/sse/lehre/bachelor-masterarbeiten/
5+
+ Run the following command to setup the virtual environment and install requirements. Including pre-commit hooks.
136

7+
> ./setup.sh -i

pyproject.toml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[build-system]
2+
# Minimum requirements for the build system to execute.
3+
requires = []
4+
5+
[tool.black]
6+
line-length = 88
7+
target_version = ['py310']
8+
preview = true
9+
exclude = '''
10+
/(
11+
\.eggs # exclude a few common directories in the
12+
| \.git # root of the project
13+
| \.mypy_cache
14+
| \.vscode
15+
| build
16+
| dist
17+
)/
18+
'''
19+
20+
[project]
21+
name = "TypeEvalPy"
22+
version = "0.0.1"
23+
24+
description = "TypeEvalPy: The Python Static Type Inference Framework"
25+
readme = "README.md"
26+
requires-python = "==3.10"
27+
classifiers = [
28+
"Programming Language :: Python :: 3",
29+
"License :: OSI Approved :: Apache Software License",
30+
"Operating System :: OS Independent",
31+
]
32+
33+
[project.urls]
34+
"Homepage" = ""
35+
"Bug Tracker" = ""
36+
37+
[tool.ruff]
38+
# Never enforce `E501` (line length violations).
39+
ignore = ["E501"]
40+
41+
# Ignore `E402` (import violations) in all `__init__.py` files
42+
[tool.ruff.per-file-ignores]
43+
"__init__.py" = ["E402"]
44+
"path/to/file.py" = ["E402"]
45+
46+
[tool.isort]
47+
profile = "black"

requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ruff==0.0.260
2+
black==23.3.0
3+
isort==5.12.0
4+
pre-commit==3.2.1
5+
pytest==7.2.2

0 commit comments

Comments
 (0)