diff --git a/setup.cfg b/.flake8 similarity index 69% rename from setup.cfg rename to .flake8 index 2c58dbe..0f02664 100644 --- a/setup.cfg +++ b/.flake8 @@ -1,6 +1,6 @@ [flake8] -max-complexity = 12 -max-line-length=127 +max-complexity = 15 +max-line-length = 120 exclude = # No need to traverse our git directory @@ -33,18 +33,6 @@ ignore = per-file-ignores = # imported but unused - __init__.py: F401 - -[mypy] -python_version = 3.7 -show_error_codes = true -ignore_errors = false -warn_return_any = false -ignore_missing_imports = true -disallow_any_generics = false -pretty = true - -[mypy-examples] -ignore_errors = true -follow_imports = silent -ignore_missing_imports = true \ No newline at end of file + __init__.py: F401, + test_*.py: D103, D104, D100, D101, D102, D106 + __version__.py: D104, D100, D101, D102 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index fc072aa..99d49e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,12 +21,15 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", ] -readme = "README.md" +readme = "docs/pypi-description.md" packages = [ {include = "ptouch_py", from = "src"}, {include = "tapen", from = "src"}, ] -include = ["tapen/resources/*", "tapen/renderer/resources/*"] +include = [ + "tapen/resources/*", "tapen/renderer/resources/*", + "LICENSE", "README.md", +] [tool.poetry.scripts] tapen = "tapen.cli:default_entrypoint" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 65e2abf..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Runtime dependencies --r requirements.txt -types-PyYAML - -# Development dependencies -copyright==1.0.1.0 -twine==1.13.0 -m2r==0.2.1 -flake8==3.9.2 -black==21.7b -mypy>=0.910 -mistune<2.0.0 -pyinstaller==4.9 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 453138c..0000000 --- a/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -# PTouch -pyusb==1.2.1 -Pillow==9.0.1 - -# Tapen -cli-rack[validation]~=1.0.1 -weasyprint==52.5 -pyyaml>=5.0.0 -appdirs>=1.4.4 -jinja2>=3.0.0 \ No newline at end of file diff --git a/src/MANIFEST.in b/src/MANIFEST.in deleted file mode 100644 index de8ea5f..0000000 --- a/src/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -include ../LICENSE LICENSE -include ../README.md README.md -recursive-include tapen/resources/ * -recursive-include tapen/renderer/resources/ * diff --git a/src/setup.py b/src/setup.py deleted file mode 100644 index db40499..0000000 --- a/src/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -# -# Tapen - software for managing label printers -# Copyright (C) 2022 Dmitry Berezovsky -# -# Tapen is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Tapen is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see .# - -import codecs -import os -from os import path - -from setuptools import setup, find_packages - -src_dir = path.abspath(path.dirname(__file__)) -root_dir = path.join(src_dir, "..") - -# == Read version == -version_override = os.environ.get("VERSION_OVERRIDE", None) or None - - -def read_file(rel_path): - here = os.path.abspath(os.path.dirname(__file__)) - with codecs.open(os.path.join(here, rel_path), "r") as fp: - return fp.read() - - -def get_version(rel_path): - for line in read_file(rel_path).splitlines(): - if line.startswith("__version__"): - delim = '"' if '"' in line else "'" - return line.split(delim)[1] - else: - raise RuntimeError("Unable to find version string.") - - -if not version_override: - version = get_version("tapen/__version__.py") -else: - print("Using overridden version: " + version_override) - version = version_override - - -# == END: Read version == - - -def read_requirements(file_name: str): - with open(file_name, "r") as f: - result = f.readlines() - return list(filter(lambda l: not (l.startswith("#") or l.strip() == ""), result)) - - -# Get the long description from the README file -readme_file = path.join(root_dir, "docs/pypi-description.md") -try: - from m2r import parse_from_file - - long_description = parse_from_file(readme_file) -except ImportError: - # m2r may not be installed in user environment - with open(readme_file) as f: - long_description = f.read() - -# Requirements -requirements_file = path.join(root_dir, "requirements.txt") -requirements = read_requirements(requirements_file) - -setup( - name="tapen", - # Semantic versioning should be used: - # https://packaging.python.org/distributing/?highlight=entry_points#semantic-versioning-preferred - version=version, - description="Tapen - software for managing label printers", - long_description=long_description, - url="https://github.com/corvis/tapen", - keywords="brother labeler print labels python cli glabels", - # Author - author="Dmitry Berezovsky", - # License - license="GPL-3.0-or-later", - # Technical meta - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - classifiers=[ - # How mature is this project? Common values are - # 3 - Alpha - # 4 - Beta - # 5 - Production/Stable - "Development Status :: 3 - Alpha", - # Who your project is intended for - "Intended Audience :: Developers", - "Topic :: Software Development :: Libraries :: Python Modules", - "Topic :: Home Automation", - # License (should match "license" above) - "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", - # Python versions support - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - ], - python_requires=">3.6", - # Structure - packages=find_packages(include=["tapen", "tapen.*", "ptouch_py", "ptouch_py.*"]), - # py_modules=["app", 'cli', 'daemonize'], - install_requires=requirements, - # Extra dependencies might be installed with: - # pip install -e .[dev,test] - extras_require={}, - include_package_data=True, - package_data={ - "": ["tapen/resources/*", "tapen/renderer/resources/*"], - }, - # test_suite='nose2.collector.collector', - # tests_require=[ - # 'nose2==0.8.0', - # ], - entry_points={ - "console_scripts": [ - "tapen=tapen.cli:default_entrypoint", - "tpp=tapen.cli:tpp_entrypoint", - ], - }, -)