From 2938f3c1793fa9827de3397b235a8ef59acc727a Mon Sep 17 00:00:00 2001 From: Linus Huzell Date: Mon, 13 Mar 2023 11:21:45 +0100 Subject: [PATCH 01/11] Ignore PyCharm files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index b6e4761..7887cc1 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,6 @@ dmypy.json # Pyre type checker .pyre/ + +# PyCharm +.idea/ \ No newline at end of file From 0d711ebecfe9b71d17367365417e3cedef719da5 Mon Sep 17 00:00:00 2001 From: Linus Huzell Date: Mon, 13 Mar 2023 11:24:34 +0100 Subject: [PATCH 02/11] Add pytest clarity --- Makefile | 2 +- dev-packages.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 978d102..f806f9d 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ venv: dev-packages.txt .PHONY: test test: venv - @ . venv/bin/activate && PYTHONPATH=src/ pytest -rsx -s --flake8 tests/ src/ --cov ./src/json_normalize/ --no-cov-on-fail --cov-report term-missing --doctest-modules --doctest-continue-on-failure + @ . venv/bin/activate && PYTHONPATH=src/ pytest -vv -rsx -s --flake8 tests/ src/ --cov ./src/json_normalize/ --no-cov-on-fail --cov-report term-missing --doctest-modules --doctest-continue-on-failure @ . venv/bin/activate && flake8 src --exclude '#*,~*,.#*' .PHONY: clean diff --git a/dev-packages.txt b/dev-packages.txt index 6e29895..fff7c56 100644 --- a/dev-packages.txt +++ b/dev-packages.txt @@ -2,4 +2,5 @@ flake8 black pytest pytest-flake8 +pytest-clarity pytest-cov \ No newline at end of file From e71ecc08dfb5df1f7b395b5379258d9010be06a4 Mon Sep 17 00:00:00 2001 From: Linus Huzell Date: Mon, 13 Mar 2023 11:24:54 +0100 Subject: [PATCH 03/11] Remove redundant argument when running pytest --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f806f9d..8a9d9d7 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ venv: dev-packages.txt .PHONY: test test: venv - @ . venv/bin/activate && PYTHONPATH=src/ pytest -vv -rsx -s --flake8 tests/ src/ --cov ./src/json_normalize/ --no-cov-on-fail --cov-report term-missing --doctest-modules --doctest-continue-on-failure + @ . venv/bin/activate && PYTHONPATH=src/ pytest -vv -rsx --flake8 tests/ src/ --cov ./src/json_normalize/ --no-cov-on-fail --cov-report term-missing --doctest-modules --doctest-continue-on-failure @ . venv/bin/activate && flake8 src --exclude '#*,~*,.#*' .PHONY: clean From ab5f32f0b2d20e0bb279c5f8cc60ae4903f82e19 Mon Sep 17 00:00:00 2001 From: Linus Huzell Date: Mon, 13 Mar 2023 11:30:14 +0100 Subject: [PATCH 04/11] Upgrade pip when creating venv --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8a9d9d7..51651db 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,9 @@ setup: venv venv: dev-packages.txt virtualenv venv --python=${PYTHON_VERSION} - . venv/bin/activate; pip3 install \ - -r dev-packages.txt + . venv/bin/activate && \ + pip3 install --upgrade pip && \ + pip3 install --requirement dev-packages.txt .PHONY: test test: venv From 65dce7f65559f9c8724839e766a7cdf9d880dca6 Mon Sep 17 00:00:00 2001 From: Linus Huzell Date: Mon, 13 Mar 2023 11:32:03 +0100 Subject: [PATCH 05/11] Add pyproject.toml --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9787c3b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" From 02d4ec0296176ba06d5255cc7da7b8d5eb49ff43 Mon Sep 17 00:00:00 2001 From: Linus Huzell Date: Mon, 13 Mar 2023 11:37:48 +0100 Subject: [PATCH 06/11] Move settings from setup.py to setup.cfg --- setup.cfg | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index a0b9358..15381fa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,4 +2,37 @@ universal = 0 [flake8] -max-line-length = 100 \ No newline at end of file +max-line-length = 100 + +[metadata] +name = json-normalize +version = attr: json-normalize.__version__ +author = The Funnel Dev Team +author_email = open-source@funnel.io +description = Recursively flattens a JSON-like structure into a list of flat dicts. +classifiers = + Development Status :: 5 - Production/Stable + License :: OSI Approved :: MIT License + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Topic :: Software Development :: Libraries +keywords = JSON +license = MIT +long_description = file: README.md +long_description_content_type = text/markdown +requires_python = ~=3.7 +project_urls = + Bug Reports = https://github.com/funnel-io/json-normalize/issues + Source = https://github.com/funnel-io/json-normalize +url = https://github.com/funnel-io/json-normalize + +[options] +package_dir = + =src +packages=find: + +[options.packages.find] +where = src From 81eb5974cc5461fb83eb4acc2fef3c7348c90de0 Mon Sep 17 00:00:00 2001 From: Linus Huzell Date: Mon, 13 Mar 2023 11:38:07 +0100 Subject: [PATCH 07/11] Remove setup.py --- setup.py | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 setup.py diff --git a/setup.py b/setup.py deleted file mode 100644 index b7a5c0b..0000000 --- a/setup.py +++ /dev/null @@ -1,42 +0,0 @@ -from os import path -from re import search -from setuptools import setup, find_packages - - -HERE = path.abspath(path.dirname(__file__)) - -with open(path.join(HERE, "README.md"), encoding="utf-8") as f: - readme = f.read() - -with open(path.join(HERE, "src", "json_normalize", "__init__.py"), encoding="utf-8") as f: - version = search(r'VERSION = "(\d+\.\d+\.\d+)"', f.read()).group(1) - -setup( - name="json-normalize", - version=version, - description="Recursively flattens a JSON-like structure into a list of flat dicts.", - license="MIT", - author="The Funnel Dev Team", - author_email="open-source@funnel.io", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Topic :: Software Development :: Libraries", - ], - keywords="JSON", - long_description=readme, - long_description_content_type="text/markdown", - package_dir={"": "src"}, - packages=find_packages(where="src"), - python_requires="~=3.7", - project_urls={ - "Bug Reports": "https://github.com/funnel-io/json-normalize/issues", - "Source": "https://github.com/funnel-io/json-normalize", - }, - url="https://github.com/funnel-io/json-normalize", -) From 0d8646ddf455d9675909f1f91f9172629386d1f9 Mon Sep 17 00:00:00 2001 From: Linus Huzell Date: Mon, 13 Mar 2023 11:47:50 +0100 Subject: [PATCH 08/11] Add __version__ attribute to init file --- src/json_normalize/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/json_normalize/__init__.py b/src/json_normalize/__init__.py index ff1aed3..74b2bba 100644 --- a/src/json_normalize/__init__.py +++ b/src/json_normalize/__init__.py @@ -1,9 +1,11 @@ from .main import json_normalize from .key_joiners import last_node_name -VERSION = "1.0.0" - __all__ = [ json_normalize, last_node_name, ] + +__version__ = "1.0.1" + +VERSION = __version__ From 550a9eb6073460e4785d73b87a6d9dd156be2b30 Mon Sep 17 00:00:00 2001 From: Linus Huzell Date: Mon, 13 Mar 2023 11:48:00 +0100 Subject: [PATCH 09/11] Remove pytest-flake8 --- Makefile | 2 +- dev-packages.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 51651db..8c44211 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ venv: dev-packages.txt .PHONY: test test: venv - @ . venv/bin/activate && PYTHONPATH=src/ pytest -vv -rsx --flake8 tests/ src/ --cov ./src/json_normalize/ --no-cov-on-fail --cov-report term-missing --doctest-modules --doctest-continue-on-failure + @ . venv/bin/activate && PYTHONPATH=src/ pytest -vv -rsx tests/ src/ --cov ./src/json_normalize/ --no-cov-on-fail --cov-report term-missing --doctest-modules --doctest-continue-on-failure @ . venv/bin/activate && flake8 src --exclude '#*,~*,.#*' .PHONY: clean diff --git a/dev-packages.txt b/dev-packages.txt index fff7c56..804b11c 100644 --- a/dev-packages.txt +++ b/dev-packages.txt @@ -1,6 +1,5 @@ flake8 black pytest -pytest-flake8 pytest-clarity pytest-cov \ No newline at end of file From cc9b9289512faaee128c6cb89b8d38a4d21d2140 Mon Sep 17 00:00:00 2001 From: Linus Huzell Date: Mon, 13 Mar 2023 12:12:45 +0100 Subject: [PATCH 10/11] Configure builds --- Makefile | 5 +++-- setup.cfg | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8c44211..8df2250 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,14 @@ dist: clean-dist - python3 setup.py sdist + pip3 install --upgrade pip build twine + python3 -m build . setup: venv venv: dev-packages.txt virtualenv venv --python=${PYTHON_VERSION} . venv/bin/activate && \ - pip3 install --upgrade pip && \ + pip3 install --upgrade pip && \ pip3 install --requirement dev-packages.txt .PHONY: test diff --git a/setup.cfg b/setup.cfg index 15381fa..f13c4bb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,7 @@ max-line-length = 100 [metadata] name = json-normalize -version = attr: json-normalize.__version__ +version = attr: json_normalize.__version__ author = The Funnel Dev Team author_email = open-source@funnel.io description = Recursively flattens a JSON-like structure into a list of flat dicts. From 818562982fb41d263e0ba3748733f9e63269e29a Mon Sep 17 00:00:00 2001 From: Linus Huzell Date: Mon, 13 Mar 2023 14:01:18 +0100 Subject: [PATCH 11/11] Revert changes to gitignore --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7887cc1..b6e4761 100644 --- a/.gitignore +++ b/.gitignore @@ -127,6 +127,3 @@ dmypy.json # Pyre type checker .pyre/ - -# PyCharm -.idea/ \ No newline at end of file