diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a892e4e..7e75bd0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,52 +2,53 @@ # See https://pre-commit.com/hooks.html for more hooks repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - - id: check-added-large-files - - id: check-ast - - id: check-case-conflict + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - id: check-ast + - id: check-case-conflict -- repo: https://github.com/myint/autoflake - rev: v2.1.1 - hooks: - - id: autoflake + - repo: https://github.com/myint/autoflake + rev: v2.1.1 + hooks: + - id: autoflake -- repo: http://github.com/PyCQA/isort - rev: 5.12.0 - hooks: - - id: isort + - repo: http://github.com/PyCQA/isort + rev: 5.12.0 + hooks: + - id: isort -- repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.3.0 - hooks: - - id: mypy - files: prototorch - additional_dependencies: [types-pkg_resources] + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.3.0 + hooks: + - id: mypy + files: prototorch + additional_dependencies: [types-pkg_resources] -- repo: https://github.com/pre-commit/mirrors-yapf - rev: v0.32.0 - hooks: - - id: yapf + - repo: https://github.com/pre-commit/mirrors-yapf + rev: v0.32.0 + hooks: + - id: yapf + additional_dependencies: ["toml"] -- repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.10.0 - hooks: - - id: python-use-type-annotations - - id: python-no-log-warn - - id: python-check-blanket-noqa + - repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.10.0 + hooks: + - id: python-use-type-annotations + - id: python-no-log-warn + - id: python-check-blanket-noqa -- repo: https://github.com/asottile/pyupgrade - rev: v3.7.0 - hooks: - - id: pyupgrade + - repo: https://github.com/asottile/pyupgrade + rev: v3.7.0 + hooks: + - id: pyupgrade -- repo: https://github.com/si-cim/gitlint - rev: v0.15.2-unofficial - hooks: - - id: gitlint - args: [--contrib=CT1, --ignore=B6, --msg-filename] + - repo: https://github.com/si-cim/gitlint + rev: v0.15.2-unofficial + hooks: + - id: gitlint + args: [--contrib=CT1, --ignore=B6, --msg-filename] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0dec2e1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,88 @@ + +[project] +name = "prototorch-models" +version = "0.5.4" +description = "Pre-packaged prototype-based machine learning models using ProtoTorch and PyTorch-Lightning." +authors = [ + { name = "Alexander Engelsberger", email = "engelsbe@hs-mittweida.de" }, +] +dependencies = ["lightning>=2.0.0", "prototorch>=0.7.5", "torchmetrics"] +requires-python = ">=3.8" +readme = "README.md" +license = { text = "MIT" } +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Environment :: Plugins", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules", +] + +[project.urls] +Homepage = "https://github.com/si-cim/prototorch_models" +Downloads = "https://github.com/si-cim/prototorch_models.git" + +[project.optional-dependencies] +dev = ["bumpversion", "pre-commit", "yapf", "toml"] +examples = ["matplotlib", "scikit-learn"] +tests = ["codecov", "pytest"] +all = [ + "bumpversion", + "codecov", + "ipykernel", + "jsonargparse", + "matplotlib", + "nbsphinx", + "pre-commit", + "yapf", + "toml", + "pytest", + "recommonmark", + "scikit-learn", + "sphinx", + "sphinx_rtd_theme", + "sphinxcontrib-bibtex", + "sphinxcontrib-katex", +] + +[project.entry-points."prototorch.plugins"] +models = "prototorch.models" + +[build-system] +requires = ["setuptools>=61", "wheel"] +build-backend = "setuptools.build_meta" + +[tool.yapf] +based_on_style = "pep8" +spaces_before_comment = 2 +split_before_logical_operator = true + +[tool.pylint] +disable = ["too-many-arguments", "too-few-public-methods", "fixme"] + +[tool.isort] +profile = "hug" +src_paths = ["isort", "test"] +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 3 +use_parentheses = true +line_length = 79 + +[tool.mypy] +explicit_package_bases = true +namespace_packages = true + +[tool.setuptools] +py-modules = ["prototorch"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index ebbcd59..0000000 --- a/setup.cfg +++ /dev/null @@ -1,27 +0,0 @@ -[yapf] -based_on_style = pep8 -spaces_before_comment = 2 -split_before_logical_operator = true - -[pylint] -disable = - too-many-arguments, - too-few-public-methods, - fixme, - - -[pycodestyle] -max-line-length = 79 - -[isort] -profile = hug -src_paths = isort, test -multi_line_output = 3 -include_trailing_comma = True -force_grid_wrap = 3 -use_parentheses = True -line_length = 79 - -[mypy] -explicit_package_bases = True -namespace_packages = True diff --git a/setup.py b/setup.py deleted file mode 100644 index 9e56977..0000000 --- a/setup.py +++ /dev/null @@ -1,99 +0,0 @@ -""" - - ###### - # # ##### #### ##### #### ##### #### ##### #### # # - # # # # # # # # # # # # # # # # # # - ###### # # # # # # # # # # # # # ###### - # ##### # # # # # # # # ##### # # # - # # # # # # # # # # # # # # # # # - # # # #### # #### # #### # # #### # #Plugin - -ProtoTorch models Plugin Package -""" -from pkg_resources import safe_name -from setuptools import find_namespace_packages, setup - -PLUGIN_NAME = "models" - -PROJECT_URL = "https://github.com/si-cim/prototorch_models" -DOWNLOAD_URL = "https://github.com/si-cim/prototorch_models.git" - -with open("README.md") as fh: - long_description = fh.read() - -INSTALL_REQUIRES = [ - "prototorch>=0.7.5", - "lightning>=2.0.0", - "torchmetrics", - "protobuf", -] -CLI = [ - "jsonargparse", -] -DEV = [ - "bumpversion", - "pre-commit", -] -DOCS = [ - "recommonmark", - "sphinx", - "nbsphinx", - "ipykernel", - "sphinx_rtd_theme", - "sphinxcontrib-katex", - "sphinxcontrib-bibtex", -] -EXAMPLES = [ - "matplotlib", - "scikit-learn", -] -TESTS = [ - "codecov", - "pytest", -] -ALL = CLI + DEV + DOCS + EXAMPLES + TESTS - -setup( - name=safe_name("prototorch_" + PLUGIN_NAME), - version="0.5.4", - description="Pre-packaged prototype-based " - "machine learning models using ProtoTorch and PyTorch-Lightning.", - long_description=long_description, - long_description_content_type="text/markdown", - author="Alexander Engelsberger", - author_email="engelsbe@hs-mittweida.de", - url=PROJECT_URL, - download_url=DOWNLOAD_URL, - license="MIT", - python_requires=">=3.8", - install_requires=INSTALL_REQUIRES, - extras_require={ - "dev": DEV, - "examples": EXAMPLES, - "tests": TESTS, - "all": ALL, - }, - classifiers=[ - "Development Status :: 2 - Pre-Alpha", - "Environment :: Plugins", - "Intended Audience :: Developers", - "Intended Audience :: Education", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.8", - "Operating System :: OS Independent", - "Topic :: Scientific/Engineering :: Artificial Intelligence", - "Topic :: Software Development :: Libraries", - "Topic :: Software Development :: Libraries :: Python Modules", - ], - entry_points={ - "prototorch.plugins": f"{PLUGIN_NAME} = prototorch.{PLUGIN_NAME}" - }, - packages=find_namespace_packages(include=["prototorch.*"]), - zip_safe=False, -)