Skip to content

Commit

Permalink
Remove __about__ file in favour of keeping constants in __init__
Browse files Browse the repository at this point in the history
This makes it possible for flit to auto-discover the version from this
file.
  • Loading branch information
pradyunsg committed Dec 8, 2022
1 parent 4221ba0 commit 45c8ee2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# Linting verifies that the project is in an acceptable state to create files
# for releasing.
# And this action should be run whenever a release is ready to go public as
# the version number will be changed by editing __about__.py.
# the version number will be changed by editing __init__.py.
needs: lint

steps:
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

ABOUT = {}
_BASE_DIR = os.path.join(os.path.dirname(__file__), os.pardir)
with open(os.path.join(_BASE_DIR, "packaging", "__about__.py")) as f:
with open(os.path.join(_BASE_DIR, "packaging", "__init__.py")) as f:
exec(f.read(), ABOUT)

# -- General configuration ----------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def docs(session):
@nox.session
def release(session):
package_name = "packaging"
version_file = Path(f"{package_name}/__about__.py")
version_file = Path(f"{package_name}/__init__.py")
changelog_file = Path("CHANGELOG.rst")

try:
Expand Down
26 changes: 0 additions & 26 deletions packaging/__about__.py

This file was deleted.

30 changes: 10 additions & 20 deletions packaging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,14 @@
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.

from .__about__ import (
__author__,
__copyright__,
__email__,
__license__,
__summary__,
__title__,
__uri__,
__version__,
)
__title__ = "packaging"
__summary__ = "Core utilities for Python packages"
__uri__ = "https://github.com/pypa/packaging"

__all__ = [
"__title__",
"__summary__",
"__uri__",
"__version__",
"__author__",
"__email__",
"__license__",
"__copyright__",
]
__version__ = "22.1.dev0"

__author__ = "Donald Stufft and individual contributors"
__email__ = "donald@stufft.io"

__license__ = "BSD-2-Clause or Apache-2.0"
__copyright__ = "2014-2019 %s" % __author__

0 comments on commit 45c8ee2

Please sign in to comment.