Skip to content

Moved the metadata into setup.cfg. #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KOLANICH
Copy link

@KOLANICH KOLANICH commented Jan 2, 2022

Added pyproject.toml.
Version is now fetched and populated automatically from git tags using setuptools_scm.
Metadata stored in source files is fetched using read_version.
Got rid of raw scripts, using console_scripts entry point since now.

@coveralls
Copy link

coveralls commented Jan 2, 2022

Coverage Status

Coverage decreased (-24.5%) to 75.472% when pulling 70cdcc0 on KOLANICH-libs:setup.cfg into 896102d on stefankoegl:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-96.2%) to 3.797% when pulling a5bab9f on KOLANICH-libs:setup.cfg into 896102d on stefankoegl:master.

@stefankoegl
Copy link
Owner

Thanks for your contribution!

Added pyproject.toml. Version is now fetched and populated automatically from git tags using setuptools_scm.

Can you please explain how that's supposed to work? The tests are failing due to the missing (not yet generated?) version.py.

@KOLANICH KOLANICH force-pushed the setup.cfg branch 2 times, most recently from e37c07f to 4c6feea Compare January 16, 2022 20:51
@KOLANICH
Copy link
Author

KOLANICH commented Jan 16, 2022

Can you please explain how that's supposed to work?

setuptools_scm is a setultools plugin (in fact poetry_core also can invoke them). It is executed on stage of package building. It detects version control system, fetches the latest tag looking like a version and populates a version from it.

The tests are failing due to the missing (not yet generated?) version.py.

You used to have version hardcoded into package, because fetching it using pkg_resources is terribly slow. Fortunately setuptools_scm has a feature to generate such files. But package building is required to generate the file.

I have added it.

Also I saw that the test for 2.7 fails in the testing module. IDK why it fails (I have not touched that file in this PR), but given that PSF itself has dropped 2.7 and that 3.4 works well on Windows XP, so ones wanting to use your module on ancient machines can just use python 3 (also a no longer supported version, but still 3 branch of python), I just disabled CI for 2.7.

The decrease in coverage is because the code that has not been tested (but that has been executed) is no longer executed, the tests succeed though.

Added `pyproject.toml`.
Version is now fetched and populated automatically from git tags using `setuptools_scm`.
Metadata stored in source files is fetched using `read_version`.
Got rid of raw scripts, using `console_scripts` entry point since now.
Dropped 2.7 out of Travis CI due to `File "tests.py", line 334, in <module> m = __import__(module, fromlist=[module]) TypeError: Item in "from list'' must be str, not unicode` error.
@stefankoegl
Copy link
Owner

I've opened the discussion about dropping Python 2.7 support at #48.

@@ -1,4 +1,5 @@
*.pyc
/jsonpointer/version.py
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this pull request has been sitting for a while, but any chance you can elaborate on why that file would be in .gitignore? For me it would seem logical to have it tracked.

@stefankoegl stefankoegl requested a review from Copilot June 10, 2025 21:35
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the project’s packaging and metadata configuration by removing setup.py, moving metadata into setup.cfg, and adding pyproject.toml to automate version management with setuptools_scm. Key changes include:

  • Removal of setup.py in favor of centralized configuration in setup.cfg and pyproject.toml.
  • Introduction of setuptools_scm for automatic version management from git tags.
  • Updates to the CI configuration in .travis.yml to utilize the new build process.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
setup.py Removed; metadata and script configuration moved to setup.cfg and pyproject.toml.
setup.cfg Added metadata, package options, and console_scripts entry point configuration.
requirements-dev.txt Added dependencies for build, setuptools_scm, and read_version; slight redundancy noticed.
pyproject.toml Introduced build system configuration supporting setuptools_scm and read_version.
jsonpointer/init.py Updated metadata handling; version now imported from a generated module.
.travis.yml Modified CI configuration to use the new build command and updated dependency installs.

@@ -1,3 +1,7 @@
wheel
twine>=1.11.0
setuptools>=38.6.0
build
setuptools
Copy link
Preview

Copilot AI Jun 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inclusion of 'setuptools' without a version conflicts with the earlier 'setuptools>=38.6.0'. Consider consolidating these requirements to avoid potential version mismatches.

Suggested change
setuptools

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants