From 245c6cc755a86b180d0d3a8a0bcb2c16667df17c Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Mon, 5 Sep 2022 18:21:46 -0500 Subject: [PATCH 1/4] refactor: Consolidate gp_libs/* to src/gp_libs.py Including what would traditionally be placed in __about__.py --- docs/conf.py | 2 +- docs/developing.md | 2 +- gp_libs/__init__.py | 12 ------------ gp_libs/__about__.py => src/gp_libs.py | 0 4 files changed, 2 insertions(+), 14 deletions(-) delete mode 100755 gp_libs/__init__.py rename gp_libs/__about__.py => src/gp_libs.py (100%) diff --git a/docs/conf.py b/docs/conf.py index 3b48bd8..f1b1599 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,7 +19,7 @@ # package data about: t.Dict[str, str] = {} -with open(project_root / "gp_libs" / "__about__.py") as fp: +with open(project_root / "src" / "gp_libs.py") as fp: exec(fp.read(), about) extensions = [ diff --git a/docs/developing.md b/docs/developing.md index 142559e..f38ea77 100644 --- a/docs/developing.md +++ b/docs/developing.md @@ -59,7 +59,7 @@ CI. See the configuration in `pyproject.toml` and `setup.cfg`: [poetry] handles virtualenv creation, package requirements, versioning, building, and publishing. Therefore there is no setup.py or requirements files. -Update `__version__` in `__about__.py` and `pyproject.toml`:: +Update `__version__` in `src/gp_libs.py` and `pyproject.toml`:: git commit -m 'build(gp_libs): Tag v0.1.1' git tag v0.1.1 diff --git a/gp_libs/__init__.py b/gp_libs/__init__.py deleted file mode 100755 index 0d9cc7b..0000000 --- a/gp_libs/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env python -import typing as t - - -def run(*args: object, **kwargs: t.Any) -> t.Optional[str]: - if args: - return "Hello" - return None - - -if __name__ == "__main__": - run() diff --git a/gp_libs/__about__.py b/src/gp_libs.py similarity index 100% rename from gp_libs/__about__.py rename to src/gp_libs.py From b8baaefda75568eb35a55fdc05a4882d9445aa93 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Mon, 5 Sep 2022 18:24:04 -0500 Subject: [PATCH 2/4] build: Remove references to gp_libs --- pyproject.toml | 1 - setup.cfg | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4185207..ec73de4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,6 @@ classifiers = [ ] packages = [ { include = "*", from = "src" }, - { include = "gp_libs" }, ] include = [ { path = "tests", format = "sdist" }, diff --git a/setup.cfg b/setup.cfg index a69e42b..d72b0de 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [flake8] -exclude = .*/,.tox,*.egg,gp_libs/__*__.py, +exclude = .*/,.tox,*.egg max-line-length = 88 extend-ignore = E203 @@ -18,6 +18,5 @@ line_length = 88 addopts = --tb=short --no-header --showlocals --doctest-modules doctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE testpaths = - gp_libs tests docs From e3dc8316d654733c167bd9e8c27bb1930dd2c4f9 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Mon, 5 Sep 2022 18:28:03 -0500 Subject: [PATCH 3/4] ci(isort): First first party libraries --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index d72b0de..9ded1f5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,7 +10,7 @@ default_section = THIRDPARTY include_trailing_comma = true multi_line_output = 3 known_pytest = pytest,py -known_first_party = gp_libs +known_first_party = gp_libs,doctest_docutils,linkify_issues,pytest_doctest_docutils,sphinx_doctree_autodoc_fix sections = FUTURE,STDLIB,PYTEST,THIRDPARTY,FIRSTPARTY,LOCALFOLDER line_length = 88 From ea97b5c524ab9f7a85d09df1c601de61a0f54254 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Mon, 5 Sep 2022 18:28:30 -0500 Subject: [PATCH 4/4] ci(isort): Fix space --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 9ded1f5..0af1ef9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,7 +5,7 @@ extend-ignore = E203 [isort] profile = black -combine_as_imports= true +combine_as_imports = true default_section = THIRDPARTY include_trailing_comma = true multi_line_output = 3