diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 0000000..e4ded8a --- /dev/null +++ b/.cspell.json @@ -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__" + ] +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5f79528 --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.vscode/settings.json b/.vscode/settings.json index 065b2f4..12ec797 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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" } diff --git a/README.md b/README.md index 7d06e5a..31ba595 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/mdrsclient/VERSION b/mdrsclient/VERSION index 524cb55..26aaba0 100644 --- a/mdrsclient/VERSION +++ b/mdrsclient/VERSION @@ -1 +1 @@ -1.1.1 +1.2.0 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..75b7416 --- /dev/null +++ b/pyproject.toml @@ -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 "] +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" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 7486add..0000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -requests -python-dotenv -pydantic -pydantic-settings -PyJWT -validators diff --git a/setup.py b/setup.py deleted file mode 100644 index becc950..0000000 --- a/setup.py +++ /dev/null @@ -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"]}, -)