introduced poetry and update vscode related environments.

This commit is contained in:
Yoshihiro OKUMURA 2023-10-04 11:29:08 +09:00
parent 4641b9304e
commit 905577fe74
Signed by: orrisroot
GPG Key ID: 470AA444C92904B2
8 changed files with 103 additions and 60 deletions

10
.cspell.json Normal file
View File

@ -0,0 +1,10 @@
{
"version": "0.2",
"language": "en,en-gb",
"ignoreWords": ["getframe", "pydantic", "UNLCK"],
"words": ["chacl", "mdrs", "mdrsclient", "neurodata", "Neuroinformatics", "RIKEN"],
"ignorePaths": [
".env",
"__pycache__"
]
}

12
.editorconfig Normal file
View File

@ -0,0 +1,12 @@
# editorconfig.org
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

17
.vscode/settings.json vendored
View File

@ -15,9 +15,12 @@
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// Extensions - Black Formatter
"black-formatter.args": ["--line-length=120"],
// Extensions - Code Spell Checker
"cSpell.ignoreWords": ["getframe", "pydantic", "UNLCK"],
"cSpell.words": ["chacl", "mdrs", "mdrsclient", "neurodata", "Neuroinformatics", "RIKEN"],
// - see: .cspell.json
// Extensions - Flake8
"flake8.args": ["--max-line-length=120"],
// Extensions - isort
"isort.args": ["--profile=black"],
// Extensions - Prettier
@ -28,16 +31,6 @@
"prettier.trailingComma": "all",
// Extensions - Pylance
"python.analysis.typeCheckingMode": "strict",
"python.analysis.exclude": ["api/migrations/[0-9]*.py"],
// Extensions - Python:black
"python.formatting.blackArgs": ["--line-length=120"],
"python.formatting.provider": "black",
// Extensions - Python:Flake8
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": ["--max-line-length=120"],
"python.linting.ignorePatterns": ["**/site-packages/**/*.py", ".vscode/*.py"],
"python.linting.lintOnSave": true,
// Extensions - Python Docstring Generator configuration
"autoDocstring.docstringFormat": "google"
}

View File

@ -5,7 +5,7 @@ The mdrs-client-python is python library and a command-line client for up- and d
## Installing
```
pip install -e .
poetry install
```
## Example Usage

View File

@ -1 +1 @@
1.1.1
1.2.0

74
pyproject.toml Normal file
View File

@ -0,0 +1,74 @@
[tool.poetry]
name = "mdrs-client-python"
version = "1.2.0"
description = "The mdrs-client-python is python library and a command-line client for up- and downloading files to and from MDRS based repository."
authors = ["Yoshihiro OKUMURA <yoshihiro.okumura@riken.jp>"]
license = "MIT"
readme = "README.md"
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"OSI Approved :: MIT License",
"Topic :: Utilities",
]
packages = [
{ include = "mdrsclient" }
]
[tool.poetry.dependencies]
python = "^3.10"
requests = "^2.31.0"
python-dotenv = "^1.0.0"
pydantic = "^2.4.2"
pydantic-settings = "^2.0.3"
PyJWT = "^2.8.0"
validators = "^0.22.0"
[tool.poetry.group.dev.dependencies]
black = "^23.9.1"
flake8 = "^6.1.0"
Flake8-pyproject = "^1.2.3"
isort = "^5.12.0"
pyright = "^1.1.329"
[tool.poetry.scripts]
mdrs = 'mdrsclient.__main__:main'
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.black]
line-length = 120
target-version = ['py310']
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.venv
| __pycache__
| dist
)/
'''
[tool.flake8]
exclude = ".git, .venv, __pycache__, dist"
max-complexity = 10
max-line-length = 120
[tool.isort]
profile = "black"
line_length = 120
[tool.mypy]
[tool.pyright]
typeCheckingMode = "basic"
exclude = ["**/__pycache__", "**/.*", "dist"]
#reportUnknownMemberType = "warning"
#reportUnknownVariableType = "warning"

View File

@ -1,6 +0,0 @@
requests
python-dotenv
pydantic
pydantic-settings
PyJWT
validators

View File

@ -1,40 +0,0 @@
import os
from typing import Final
from setuptools import find_packages, setup
from mdrsclient import __version__
BASE_DIR: Final[str] = os.path.realpath(os.path.dirname(__file__))
with open(os.path.join(BASE_DIR, "requirements.txt")) as f:
__requirements__ = f.read().splitlines()
with open(os.path.join(BASE_DIR, "README.md")) as f:
__readme__ = f.read()
setup(
name="mdrsclient",
version=__version__,
description="A MDRS command-line tool",
long_description=__readme__,
author="Neuroinformatics Unit, RIKEN CBS",
license="MIT",
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"OSI Approved :: MIT License",
"Topic :: Utilities",
],
packages=find_packages(),
include_package_data=True,
package_data={
"mdrsclient": ["VERSION"],
},
install_requires=__requirements__,
entry_points={"console_scripts": ["mdrs=mdrsclient.__main__:main"]},
)