Skip to content

Commit

Permalink
build(project): 🏗️ 配置依赖项
Browse files Browse the repository at this point in the history
  • Loading branch information
SongshGeo committed Feb 17, 2023
1 parent bf9d783 commit fed2937
Show file tree
Hide file tree
Showing 10 changed files with 1,775 additions and 0 deletions.
129 changes: 129 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# 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/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
repos:
- repo: https://github.com/psf/black
rev: '23.1.0'
hooks:
- id: black
- id: black-jupyter
- repo: https://github.com/PyCQA/flake8
rev: '6.0.0'
hooks:
- id: flake8
args: ['--max-line-length=88', '--extend-ignore=E203,E501,W503', '--exclude=.venv']
- repo: https://github.com/PyCQA/isort
rev: '5.12.0'
hooks:
- id: isort
args: ['--profile=black']
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
# - repo: https://github.com/pycqa/pydocstyle
# rev: '6.3.0'
# hooks:
# - id: pydocstyle
# args: ['--convention=google', '--add-ignore=D100,D101,D102,D103,D104,D105,D106,D107']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.4.0'
hooks:
- id: check-ast
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-poetry/poetry
rev: '1.3.0' # add version here
hooks:
- id: poetry-check
- id: poetry-lock
- id: poetry-export
args: ["-f", "requirements.txt", "--without-hashes", "-o", "requirements.txt"]
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"conventionalCommits.scopes": [
"project"
]
}
36 changes: 36 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
setup:
make install-tests
make install-jupyter
make setup-pre-commit

# 安装必要的代码检查工具
# black: https://github.com/psf/black
# flake8: https://github.com/pycqa/flake8
# isort: https://github.com/PyCQA/isort
# nbstripout: https://github.com/kynan/nbstripout
# pydocstyle: https://github.com/PyCQA/pydocstyle
# pre-commit-hooks: https://github.com/pre-commit/pre-commit-hooks
setup-pre-commit:
poetry add --group dev flake8 isort nbstripout pydocstyle pre-commit-hooks
poetry run pre-commit install

install-jupyter:
poetry add ipykernel --group dev

install-tests:
poetry add pytest allure-pytest --group dev

# https://timvink.github.io/mkdocs-git-authors-plugin/index.html
install-docs:
poetry add --group docs mkdocs mkdocs-material
poetry add --group docs mkdocs-git-revision-date-localized-plugin
poetry add --group docs mkdocs-minify-plugin
poetry add --group docs mkdocs-redirects
poetry add --group docs mkdocs-awesome-pages-plugin
poetry add --group docs mkdocs-git-authors-plugin
poetry add --group docs mkdocstrings\[python\]
poetry add --group docs mkdocs-bibtex
poetry add --group docs mkdocs-macros-plugin
# poetry add --group docs mkdocs-jupyter
poetry add --group docs mkdocs-callouts
poetry add --group docs mkdocs-glightbox
Empty file added mksci_font/__init__.py
Empty file.
Loading

0 comments on commit fed2937

Please sign in to comment.