Skip to content

Remove docs dependency on setuptools_scm #989

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

Closed
wants to merge 8 commits into from

Conversation

cidrblock
Copy link
Collaborator

@cidrblock cidrblock commented Feb 21, 2022

Part of ongoing work to remove ignore_imports for mypy.

In this case, rather than account for setuptools_scm in the mypy.ini as untyped (pypa/setuptools-scm#501), simply remove the dependency on it entirely.

Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

setuptools-scm is necessary for building from Git checkout. It is by design that it produces unique versions for builds that make it easier to identify the source of a specific build. It should remain in use.

It is also visible @ https://ansible-navigator--989.org.readthedocs.build/en/989/changelog/#v1-1-0-alpha-1-as-of-today-unreleased-draft that this PR breaks both the displayed version and the hardcoded version identifier that became incompatible with PEP 440 (it must be compliant for PyPI uploads not to be rejected and for pip to understand the semantics of the given version).

# The short X.Y version
version = ".".join(
Copy link
Member

Choose a reason for hiding this comment

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

This is a Sphinx setting. Don't lose it. Although, I'm still against breaking what setuptools-scm provides. If you want to reuse the installed dist metadata, you'd have to (1) integrate setuptools-scm into packaging first and then (2) somehow solve the self-reinstallation on every local build in an optimal way (without tox -r).

@@ -45,6 +45,8 @@
name = "Contributor-facing changes"
showcontent = true

[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"]
Copy link
Member

Choose a reason for hiding this comment

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

wheel shouldn't be in this list, setuptools' PEP 517 build backend auto-adds it already.

Copy link
Member

Choose a reason for hiding this comment

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

(and of course move this to a separate PR as well)

Copy link
Member

Choose a reason for hiding this comment

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

There's a separate issue for that so don't forget to link it too: #553.

Copy link
Member

Choose a reason for hiding this comment

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

See also: #554

@@ -95,3 +97,5 @@ skip_glob = ["tests/fixtures/common/collections*"] # Skip ansible content due to

[tool.pylint.format]
max-line-length = 100

[tool.setuptools_scm]
Copy link
Member

Choose a reason for hiding this comment

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

This whole dist packaging setup refactoring should go into a separate PR as it's not related to docs. It could be accepted separately while the rest of this PR is still in a state that has to be rejected.

Copy link
Member

Choose a reason for hiding this comment

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

(side note: that separate PR should probably also make use of the write_to setting)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It can't yet. The _version file contains more than just the package version.

Copy link
Member

@webknjaz webknjaz Feb 21, 2022

Choose a reason for hiding this comment

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

No, you can do that now. Just don't point it at an existing file. Instead, point it at a gitignored _scm_version.py that you'd import from the _version.py.
Example: https://github.com/sphinx-contrib/sphinxcontrib-towncrier/blob/532e343/pyproject.toml#L16 + https://github.com/sphinx-contrib/sphinxcontrib-towncrier/blob/532e343/src/sphinxcontrib/towncrier/_version.py#L5.

P.S. Also, the same approach is used in ansible-pylibssh.

Copy link
Member

Choose a reason for hiding this comment

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

Pro tip: create a _scm_version.pyi to take care of typing.

@cidrblock
Copy link
Collaborator Author

cidrblock commented Feb 21, 2022

This PR is being closed.

@cidrblock cidrblock closed this Feb 21, 2022
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.

2 participants