diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2a3e1646..c4a9fdc4 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -44,7 +44,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ steps.pip-cache.outputs.dir }} - key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }} + key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('pyproject.toml') }}|${{ hashFiles('requirements/*.txt') }} - run: pip install tox - run: tox -e ${{ matrix.tox }},coverage-report - name: "Upload coverage to Codecov" diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 86a32c02..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include LICENSE CHANGELOG.md tox.ini requirements.txt requirements-rtd.txt .coveragerc Makefile pytest.ini .tox-coveragerc -exclude TODO.md codecov.yml .readthedocs.yaml requirements.in -global-exclude flycheck_* - -graft glom/test/data -graft docs -prune docs/_build diff --git a/glom/_version.py b/glom/_version.py index 9c79468e..831de66f 100644 --- a/glom/_version.py +++ b/glom/_version.py @@ -1,2 +1,4 @@ -version_info = (24, 11, 1, 'dev') -__version__ = '.'.join([str(part) for part in version_info if part or part == 0]) +__version__ = "24.11.1.dev" +version_info = tuple( + int(part) if part.isdigit() else part for part in __version__.split(".") +) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..b960796c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,76 @@ +[project] +name = "glom" +dynamic = ["version"] +description = "A declarative object transformer and formatter, for conglomerating nested data." +readme = "README.md" +authors = [ + { name = "Mahmoud Hashemi and Kurt Rose", email = "mahmoud@hatnote.com" }, +] +classifiers = [ + "Topic :: Utilities", + "Intended Audience :: Developers", + "Topic :: Software Development :: Libraries", + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +dependencies = ["boltons>=19.3.0", "attrs", "face>=20.1.1"] +license = "BSD-3-Clause" +requires-python = ">=3.7" + +[project.optional-dependencies] +toml = ["tomli; python_version < '3.11'"] +yaml = ["PyYAML"] + +[project.scripts] +glom = "glom.cli:console_main" + +[project.urls] +Homepage = "https://github.com/mahmoud/glom" +Documentation = "https://glom.readthedocs.io/en/latest/" + +[tool.flit.sdist] +include = [ + "docs/", + "CHANGELOG.md", + "requirements.txt", + "tox.ini", + ".tox-coveragerc", +] +exclude = ["docs/_build"] + +[tool.pytest.ini_options] +doctest_optionflags = [ + "NORMALIZE_WHITESPACE", + "IGNORE_EXCEPTION_DETAIL", + "ELLIPSIS", +] + +[build-system] +requires = ["flit_core >=3.11,<4"] +build-backend = "flit_core.buildapi" + +# A brief checklist for release: + +# * tox +# * git commit (if applicable) +# * Bump glom/_version.py off of -dev +# * git commit -a -m "bump version for vx.y.z release" +# * write CHANGELOG +# * bump docs/conf.py version +# * git commit +# * rm -rf dist/* +# * python3 -m build +# * twine upload dist/* +# * git tag -a vx.y.z -m "brief summary" +# * bump glom/_version.py onto n+1 dev +# * git commit +# * git push + +# NB: if dropping support for a python version, bump the pyupgrade argument in tox and run syntax-upgrade tox env. diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index f6cd3a76..00000000 --- a/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -doctest_optionflags=NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS diff --git a/setup.py b/setup.py deleted file mode 100644 index 8542f142..00000000 --- a/setup.py +++ /dev/null @@ -1,88 +0,0 @@ -import importlib.util -import os - -from setuptools import setup - -__author__ = 'Mahmoud Hashemi and Kurt Rose' -__contact__ = 'mahmoud@hatnote.com' -__url__ = 'https://github.com/mahmoud/glom' - - -def import_path(module_name, path): - spec = importlib.util.spec_from_file_location(module_name, path) - module = importlib.util.module_from_spec(spec) - spec.loader.exec_module(module) - return module - - -CUR_PATH = os.path.abspath(os.path.dirname(__file__)) -_version_mod_path = os.path.join(CUR_PATH, 'glom', '_version.py') -_version_mod = import_path('_version', _version_mod_path) -__version__ = _version_mod.__version__ - - -open_kwarg = {} - -with open('README.md', encoding='utf8') as read_me: - long_description = read_me.read() - -setup(name='glom', - version=__version__, - description="A declarative object transformer and formatter, for conglomerating nested data.", - long_description=long_description, - long_description_content_type='text/markdown', - author=__author__, - author_email=__contact__, - url=__url__, - project_urls={ - 'Documentation': 'https://glom.readthedocs.io/en/latest/', - }, - packages=['glom', 'glom.test'], - install_requires=['boltons>=19.3.0', 'attrs', 'face>=20.1.1'], - extras_require={ - 'toml': ['tomli; python_version<"3.11"'], - 'yaml': ['PyYAML'], - }, - entry_points={'console_scripts': ['glom = glom.cli:console_main']}, - include_package_data=True, - zip_safe=False, - platforms='any', - license_files=['LICENSE'], - classifiers=[ - 'Topic :: Utilities', - 'Intended Audience :: Developers', - 'Topic :: Software Development :: Libraries', - 'Development Status :: 5 - Production/Stable', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - 'License :: OSI Approved :: BSD License', - ] - ) - -""" -A brief checklist for release: - -* tox -* git commit (if applicable) -* Bump glom/_version.py off of -dev -* git commit -a -m "bump version for vx.y.z release" -* write CHANGELOG -* bump docs/conf.py version -* git commit -* rm -rf dist/* -* python setup.py sdist bdist_wheel -* twine upload dist/* -* git tag -a vx.y.z -m "brief summary" -* bump glom/_version.py onto n+1 dev -* git commit -* git push - -NB: if dropping support for a python version, bump the pyupgrade argument in tox and run syntax-upgrade tox env. - -"""