Skip to content

Commit 3960e48

Browse files
committed
first commit
0 parents  commit 3960e48

47 files changed

Lines changed: 5090 additions & 0 deletions

Some content is hidden

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

.coveragerc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[report]
2+
exclude_lines =
3+
if __name__ == "__main__":
4+
def __str__
5+
6+
[run]
7+
omit =
8+
*/__init__.py
9+
pylearning/__main__.py

.devcontainer/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FROM python:3.9.11-slim-bullseye
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
ARG USER=user
5+
6+
ENV container docker
7+
8+
USER root
9+
10+
# Create non-root user
11+
RUN groupadd $USER && useradd --gid $USER --shell /bin/bash --create-home $USER
12+
13+
RUN echo "Install dependencies..."\
14+
&& apt-get update\
15+
&& apt-get install\
16+
unixodbc-dev\
17+
build-essential\
18+
ca-certificates\
19+
curl\
20+
git-all\
21+
jq\
22+
htop\
23+
less\
24+
nano\
25+
vim\
26+
wget\
27+
zsh\
28+
-y --no-install-recommends\
29+
&& apt-get clean\
30+
&& rm -rf /var/lib/apt/lists/*
31+
32+
RUN echo "Install Conda..."\
33+
&& cd /tmp\
34+
&& curl https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh --progress-bar -o installer.sh\
35+
&& bash installer.sh -b -p $HOME/anaconda3
36+
&& rm installer.sh
37+
38+
# Upgrade pip then install poetry and wheel
39+
RUN pip3 install --no-cache-dir --upgrade pip \
40+
&& pip3 install --no-cache-dir wheel poetry
41+
42+
# Install oh-my-zsh
43+
RUN yes Y | sh -c "$(curl -k -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
44+
45+
COPY .devcontainer/config_devcontainer.sh /tmp
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
git config --system --add safe.directory .
3+
git config --system core.autocrlf false
4+
git config --system pull.rebase false
5+
git config --system core.ignoreCase false
6+
git config --system http.sslVerify false
7+
git config --system core.editor.nano
8+
9+
# Fetch to make sure that credentials are stored when installing dependencies
10+
git config --system credential.helper store
11+
12+
git fetch
13+
14+
poetry config experimental.system-git-client true
15+
poetry config virtualenvs.create false
16+
17+
poetry install --all-extras
18+
19+
mkdir ~/.zfunc
20+
poetry completions zsh > ~/.zfunc/_poetry
21+
22+
echo "fpath+=~/.zfunc/_poetry" >> ~/.zshrc
23+
echo "autoload -Uz compinit && compinit" >> ~/.zshrc
24+
25+
pre-commit install --hook-type pre-commit --hook-type pre-push --hook-type pre-merge-commit

.devcontainer/devcontainer.env

Whitespace-only changes.

.devcontainer/devcontainer.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.155.1/containers/python-3
3+
{
4+
"name": "python_learning",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"context": "..",
8+
"args": {
9+
}
10+
},
11+
12+
"runArgs": ["--env-file", ".devcontainer/devcontainer.env"],
13+
14+
"containerUser": "root",
15+
16+
// Set *default* container specific settings.json values on container create.
17+
"settings": {
18+
"autoDocstring.docstringFormat": "sphinx",
19+
"python.pythonPath": "python",
20+
"python.languageServer": "Pylance",
21+
"python.linting.enabled": true,
22+
"python.linting.pylintEnabled": true,
23+
"python.linting.flake8Path": "/usr/local/bin/flake8",
24+
"python.linting.pylintPath": "/usr/local/bin/pylint",
25+
"python.testing.pytestPath": "/usr/local/bin/pytest",
26+
"python.testing.pytestEnabled": true,
27+
"python.testing.pytestArgs": ["tests"],
28+
"terminal.integrated.defaultProfile.linux": "zsh"
29+
},
30+
31+
// Add the IDs of extensions you want installed when the container is created.
32+
"extensions": [
33+
"ms-python.python",
34+
"njpwerner.autodocstring",
35+
"hediet.vscode-drawio",
36+
"docsmsft.docs-markdown",
37+
"streetsidesoftware.code-spell-checker",
38+
"ms-toolsai.jupyter",
39+
"ms-toolsai.jupyter-renderers",
40+
"shuworks.vscode-table-formatter",
41+
"redhat.vscode-yaml",
42+
"trond-snekvik.simple-rst"
43+
],
44+
45+
// Use 'postCreateCommand' to run commands after the container is created.
46+
"postCreateCommand": "bash /tmp/config_devcontainer.sh"
47+
}

.devcontainer/devcontainer_f1.env

Whitespace-only changes.

.dockerignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.git
2+
.devcontainer
3+
!.devcontainer/config_devcontainer.sh
4+
.dockerignore
5+
.editorconfig
6+
.gitignore
7+
.idea
8+
.pytest_cache
9+
.vscode
10+
.pre-commit-config.yaml
11+
Dockerfile
12+
htmlcov
13+
LICENSE
14+
*.code-workspace
15+
*__pycacye__*
16+
*.log*

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
11+
end_of_line = lf
12+
13+
[*.bat]
14+
indent_style = tab
15+
end_of_line = crlf
16+
17+
[LICENSE]
18+
insert_final_newline = false
19+
20+
[Makefile]
21+
indent_style = tab

.gitignore

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
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+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
test_result.xml
50+
51+
# Translations
52+
*.mo
53+
*.pot
54+
55+
# Django stuff:
56+
*.log
57+
local_settings.py
58+
59+
# Flask stuff:
60+
instance/
61+
.webassets-cache
62+
63+
# Scrapy stuff:
64+
.scrapy
65+
66+
# Sphinx documentation
67+
docs/build/
68+
docs/source/*.rst
69+
docs/source/*.md
70+
!docs/source/index.rst
71+
!docs/source/installation.rst
72+
!docs/source/usage.rst
73+
!docs/source/profiling.rst
74+
75+
# PyBuilder
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# pyenv
82+
.python-version
83+
84+
# celery beat schedule file
85+
celerybeat-schedule
86+
87+
# SageMath parsed files
88+
*.sage.py
89+
90+
# dotenv
91+
.env
92+
93+
# virtualenv
94+
.venv
95+
venv/
96+
ENV/
97+
98+
# Spyder project settings
99+
.spyderproject
100+
.spyproject
101+
102+
# Rope project settings
103+
.ropeproject
104+
105+
# mkdocs documentation
106+
/site
107+
108+
# mypy
109+
.mypy_cache/
110+
111+
# IDE settings
112+
.vscode/
113+
.idea/
114+
115+
# Data files
116+
data/*
117+
!data/.gitkeep
118+
119+
# Pickle files
120+
*.pickle
121+
*.pickle.*
122+
123+
# Logs
124+
*.log
125+
*.log.*
126+
127+
# Temp folder for testing
128+
.tmp
129+
130+
# Testmon data file
131+
.testmondata

.pre-commit-config.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
default_stages: [commit, merge-commit, push]
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v3.2.0
7+
hooks:
8+
- id: trailing-whitespace
9+
stages: [commit, merge-commit]
10+
- id: end-of-file-fixer
11+
stages: [commit, merge-commit]
12+
- id: fix-encoding-pragma
13+
stages: [commit, merge-commit]
14+
- id: mixed-line-ending
15+
stages: [commit, merge-commit]
16+
args: ['--fix=lf']
17+
18+
- repo: https://github.com/kynan/nbstripout
19+
rev: 0.3.9
20+
hooks:
21+
- id: nbstripout
22+
stages: [commit, merge-commit]
23+
24+
- repo: local
25+
hooks:
26+
- id: formatters
27+
name: Run code formatters
28+
entry: make
29+
args: [format]
30+
pass_filenames: false
31+
language: system
32+
stages: [commit, merge-commit]

0 commit comments

Comments
 (0)