From dcfed8d92d18537b4850e1ba32f60c8f0e7c8c73 Mon Sep 17 00:00:00 2001 From: pylipp Date: Thu, 29 Sep 2022 12:05:32 +0200 Subject: [PATCH 1/6] First run of ini2toml --- pyproject.toml | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 94d86dc..9e359d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,47 @@ [build-system] -requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"] +requires = ["setuptools>=61.2", "wheel", "setuptools_scm>=6.2"] build-backend = "setuptools.build_meta" +[project] +name = "financeager" +description = "command line tool for organizing finances" +keywords = [ "commandline finances",] +classifiers = [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: End Users/Desktop", "Intended Audience :: Other Audience", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: Unix", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Topic :: Office/Business :: Financial", "Topic :: Database", "Topic :: Utilities",] +dependencies = [ "tinydb==4.7.0", "python-dateutil==2.8.2", "marshmallow==3.18.0", "argcomplete==2.0.0", "appdirs==1.4.4", "rich==12.5.1",] +dynamic = [ "version",] +[[project.authors]] +name = "Philipp Metzner" +email = "beth.aleph@yahoo.de" + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.license] +text = "GPLv3" + +[project.urls] +Homepage = "https://github.com/pylipp/financeager" + +[project.optional-dependencies] +packaging = [ "build", "twine>=1.11.0",] +develop = [ "coverage==6.4.4", "pre-commit==2.20.0", "gitlint-core==0.17.0", "flake8==5.0.4", "black==22.8.0", "isort==5.10.1",] + +[project.scripts] +fina = "financeager.cli:main" + +[tool.setuptools] +include-package-data = false + +[tool.coverage.run] +branch = true +source = [ "financeager",] + +[tool.coverage.report] +exclude_lines = [ "pragma: no cover", "if __name__ == .__main__.:", "except Exception:", "def .*main()",] + +[tool.setuptools.packages.find] +exclude = [ "test",] +namespaces = false + [tool.setuptools_scm] From 881415af560d9696d5ef295546f55e1fc7b14933 Mon Sep 17 00:00:00 2001 From: pylipp Date: Thu, 29 Sep 2022 13:53:01 +0200 Subject: [PATCH 2/6] Sort pyproject.toml sections and add isort/coverage config --- pyproject.toml | 90 +++++++++++++++++++++++++++++++++++++------------- setup.cfg | 19 ----------- 2 files changed, 67 insertions(+), 42 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9e359d4..73a3b0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,31 +1,62 @@ [build-system] -requires = ["setuptools>=61.2", "wheel", "setuptools_scm>=6.2"] build-backend = "setuptools.build_meta" +requires = [ + "setuptools>=61.2", + "setuptools_scm[toml]>=6.2", + "wheel", +] [project] name = "financeager" description = "command line tool for organizing finances" -keywords = [ "commandline finances",] -classifiers = [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: End Users/Desktop", "Intended Audience :: Other Audience", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: Unix", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Topic :: Office/Business :: Financial", "Topic :: Database", "Topic :: Utilities",] -dependencies = [ "tinydb==4.7.0", "python-dateutil==2.8.2", "marshmallow==3.18.0", "argcomplete==2.0.0", "appdirs==1.4.4", "rich==12.5.1",] -dynamic = [ "version",] -[[project.authors]] -name = "Philipp Metzner" -email = "beth.aleph@yahoo.de" - -[project.readme] -file = "README.md" -content-type = "text/markdown" - -[project.license] -text = "GPLv3" +authors = [{ name = "Philipp Metzner", email = "beth.aleph@yahoo.de" }] +keywords = ["commandline", "finances"] +readme = "README.md" +dynamic = ["version"] +license = {file = "LICENSE.md"} +dependencies = [ + "appdirs==1.4.4", + "argcomplete==2", + "marshmallow==3.18", + "python-dateutil==2.8.2", + "rich==12.5.1", + "tinydb==4.7", +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Intended Audience :: End Users/Desktop", + "Intended Audience :: Other Audience", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: Unix", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Topic :: Office/Business :: Financial", + "Topic :: Database", + "Topic :: Utilities", +] [project.urls] Homepage = "https://github.com/pylipp/financeager" +Documentation = "https://github.com/pylipp/financeager" +"Source Code" = "https://github.com/pylipp/financeager" +"Bug Tracker" = "https://github.com/pylipp/financeager/issues" [project.optional-dependencies] -packaging = [ "build", "twine>=1.11.0",] -develop = [ "coverage==6.4.4", "pre-commit==2.20.0", "gitlint-core==0.17.0", "flake8==5.0.4", "black==22.8.0", "isort==5.10.1",] +develop = [ + "black==22.8", + "coverage==6.4.4", + "flake8==5.0.4", + "gitlint-core==0.17", + "isort==5.10.1", + "pre-commit==2.20", +] +packaging = [ + "build", + "twine>=1.11", +] [project.scripts] fina = "financeager.cli:main" @@ -33,15 +64,28 @@ fina = "financeager.cli:main" [tool.setuptools] include-package-data = false +[tool.setuptools.packages.find] +exclude = ["test"] +namespaces = false + [tool.coverage.run] branch = true -source = [ "financeager",] +source = ["financeager"] [tool.coverage.report] -exclude_lines = [ "pragma: no cover", "if __name__ == .__main__.:", "except Exception:", "def .*main()",] - -[tool.setuptools.packages.find] -exclude = [ "test",] -namespaces = false +exclude_lines = [ + "pragma: no cover", + "if __name__ == .__main__.:", + "except Exception:", + "def .*main()", +] [tool.setuptools_scm] + +[tool.isort] +profile = "black" +line_length = 88 +multi_line_output = 3 +include_trailing_comma = true +ensure_newline_before_comments = true +known_third_party = ["appdirs","argcomplete","dateutil","marshmallow","pkg_resources","setuptools","tinydb"] diff --git a/setup.cfg b/setup.cfg index bbaf3f7..008c854 100644 --- a/setup.cfg +++ b/setup.cfg @@ -52,25 +52,6 @@ develop = black==22.8.0 isort==5.10.1 -[coverage:run] -branch = true -source = financeager - -[coverage:report] -exclude_lines = - pragma: no cover - if __name__ == .__main__.: - except Exception: - def .*main() - -[isort] -profile = black -line_length = 88 -multi_line_output = 3 -include_trailing_comma = True -ensure_newline_before_comments = True -known_third_party = appdirs,argcomplete,dateutil,marshmallow,pkg_resources,setuptools,tinydb - [flake8] max-line-length = 88 ignore = E731, # do not assign a lambda expression, use a def From 5815b543822289185ca08d047a92d9ded411d565 Mon Sep 17 00:00:00 2001 From: pylipp Date: Mon, 10 Oct 2022 20:14:55 +0200 Subject: [PATCH 3/6] Use pyproject-flake8 wrapper --- .pre-commit-config.yaml | 2 +- pyproject.toml | 11 ++++++++++- setup.cfg | 6 ------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 02fc58e..a003327 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: require_serial: true - id: flake8 name: flake8 - entry: flake8 + entry: pflake8 types: [python] language: system require_serial: true diff --git a/pyproject.toml b/pyproject.toml index 73a3b0f..07acf25 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,8 @@ Documentation = "https://github.com/pylipp/financeager" develop = [ "black==22.8", "coverage==6.4.4", - "flake8==5.0.4", + 'pyproject-flake8==5.0.4; python_version >= "3.8"', + 'pyproject-flake8==5.0.4.post1; python_version < "3.8"', "gitlint-core==0.17", "isort==5.10.1", "pre-commit==2.20", @@ -89,3 +90,11 @@ multi_line_output = 3 include_trailing_comma = true ensure_newline_before_comments = true known_third_party = ["appdirs","argcomplete","dateutil","marshmallow","pkg_resources","setuptools","tinydb"] + +[tool.flake8] +max-line-length = 88 +extend-ignore = [ + "E731", # do not assign a lambda expression, use a def + "W503", # line break before binary operator + "W504", # line break after binary operator +] diff --git a/setup.cfg b/setup.cfg index 008c854..f9bf059 100644 --- a/setup.cfg +++ b/setup.cfg @@ -51,9 +51,3 @@ develop = flake8==5.0.4 black==22.8.0 isort==5.10.1 - -[flake8] -max-line-length = 88 -ignore = E731, # do not assign a lambda expression, use a def - W503, # line break before binary operator - W504, # line break after binary operator From fe6443b54ffb159c7a0ce723a576dc84a5d0ef82 Mon Sep 17 00:00:00 2001 From: pylipp Date: Mon, 10 Oct 2022 20:26:42 +0200 Subject: [PATCH 4/6] Remove setup.cfg --- setup.cfg | 53 ----------------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 setup.cfg diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index f9bf059..0000000 --- a/setup.cfg +++ /dev/null @@ -1,53 +0,0 @@ -[metadata] -name = financeager -description = command line tool for organizing finances -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/pylipp/financeager -author = Philipp Metzner -author_email = beth.aleph@yahoo.de -license = GPLv3 -keywords = commandline finances -classifiers = - Development Status :: 3 - Alpha - Environment :: Console - Intended Audience :: End Users/Desktop - Intended Audience :: Other Audience - License :: OSI Approved :: GNU General Public License v3 (GPLv3) - Operating System :: Unix - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Topic :: Office/Business :: Financial - Topic :: Database - Topic :: Utilities - -[options] -packages = find: -install_requires = - tinydb==4.7.0 - python-dateutil==2.8.2 - marshmallow==3.18.0 - argcomplete==2.0.0 - appdirs==1.4.4 - rich==12.5.1 - -[options.packages.find] -exclude = test - -[options.entry_points] -console_scripts = - fina = financeager.cli:main - -[options.extras_require] -packaging = - build - twine>=1.11.0 -develop = - coverage==6.4.4 - pre-commit==2.20.0 - gitlint-core==0.17.0 - flake8==5.0.4 - black==22.8.0 - isort==5.10.1 From c78c2649094dcea1c8fdc555805c7e388591d9c3 Mon Sep 17 00:00:00 2001 From: pylipp Date: Mon, 10 Oct 2022 20:45:42 +0200 Subject: [PATCH 5/6] Hash pyproject.toml file for GitHub actions cache --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c59ab27..ce69191 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,8 +38,7 @@ jobs: with: # This path is specific to Ubuntu path: ~/.cache/pip - # Look to see if there is a cache hit for the corresponding setup file (better: requirements.txt) - key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }} + key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} restore-keys: | ${{ runner.os }}-pip- ${{ runner.os }}- From a759d9b54166e8e7e61387b3a2a178e98538d21f Mon Sep 17 00:00:00 2001 From: pylipp Date: Mon, 10 Oct 2022 20:49:55 +0200 Subject: [PATCH 6/6] Update Changelog fixes #127 [skip ci] --- Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.md b/Changelog.md index 6e000c8..2276967 100644 --- a/Changelog.md +++ b/Changelog.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Update dependencies `rich` and `marshmallow`. (#124,#126) - Checks for dependency updates are run monthly instead of weekly. +- Use `pyproject.toml` instead of `setup.cfg` for project configuration. ## [v1.1.1] - 2022-08-17 ### Changed