Skip to content

Commit

Permalink
Update setup.py of configured packages with small textual changes. (#…
Browse files Browse the repository at this point in the history
…300)

This is needed to match current best practices.

Fixes #288.
  • Loading branch information
icemac authored Jan 29, 2025
1 parent 55111d5 commit 47c4de0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[meta]
template = "pure-python"
commit-id = "c95980ef"
commit-id = "55111d56"

[python]
with-windows = false
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Change log
- Add ``omit`` option to ``coverage-run`` configuration because when defined in
``pyproject.toml`` it needs to be a list of strings.

- Update ``setup.py`` of configured packages with small textual changes to
match current best practices.

1.0 (2024-10-02)
----------------

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def read(*rnames):
'Natural Language :: English',
'Operating System :: OS Independent',
],
license='ZPL 2.1',
license='ZPL-2.1',
url='https://github.com/zopefoundation/meta',
project_urls={
'Documentation': 'https://zopemeta.readthedocs.io',
Expand Down
16 changes: 16 additions & 0 deletions src/zope/meta/config_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
https://github.com/zopefoundation/meta/tree/master/config/{config_type}
-->"""
DEFAULT = object()
SETUP_PY_REPLACEMENTS = {
'ZPL 2.1': 'ZPL-2.1',
'[email protected]': '[email protected]',
'Zope Corporation': 'Zope Foundation',
'Framework :: Zope2': 'Framework :: Zope :: 2',
'Framework :: Zope3': 'Framework :: Zope :: 3',
}


def handle_command_line_arguments():
Expand Down Expand Up @@ -355,6 +362,14 @@ def setup_cfg(self):
zest_releaser_options=zest_releaser_options,
)

def setup_py(self):
"""Update setup.py to current texts."""
setup_py = self.path / 'setup.py'
setup_py_content = setup_py.read_text()
for src, dest in SETUP_PY_REPLACEMENTS.items():
setup_py_content = setup_py_content.replace(src, dest)
setup_py.write_text(setup_py_content)

def gitignore(self):
git_ignore = self.meta_cfg['git'].get('ignore', [])

Expand Down Expand Up @@ -656,6 +671,7 @@ def configure(self):

self.pyproject_toml()
self.setup_cfg()
self.setup_py()
self.gitignore()
self.pre_commit_config_yaml()
self.copy_with_meta(
Expand Down

0 comments on commit 47c4de0

Please sign in to comment.