Skip to content
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

port setuptools options to declarative config #40

Merged
merged 2 commits into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include ChangeLog
# implied by setup.cfg -> license_files, repeated for clarity
include COPYING
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we put just this line back? I actually prefer if files are explicitly listed in MANIFEST.in rather than having to guess what other logic elsewhere is including files.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am fine if it is also listed in setup.cfg -- for me that's actually separate information, i.e. "this is a file containing the license" while MANIFEST.in is "please include this file in the source distribution".

Copy link
Contributor Author

@eli-schwartz eli-schwartz Mar 10, 2021

Choose a reason for hiding this comment

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

It's a file specifically called out in the metadata, just like py_modules or packages. But instead of declaring it as an importable source file, it's declared as a dist-info file which must be installed as wheel metadata. Since it must be installed as wheel metadata, it also must be included in the source dist in order to guarantee it makes its way into the wheel, and is thus guaranteed to be collected during the dist creation.

I disagree with your analysis -- I don't view this as guessable logic -- but if you still want it I'll put it back.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would still like it back -- I have been bitten so often by files not being included in the source distribution that I just want one place that I can look.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, will do.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you! Apologies for being a pain about it. :|

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol, I wish every PR review was this simple to solve.

"Looks good, just please include this minor nitpicky line that I really like even though it's a no-op."

(I mean, it's lots better than "I disagree with the functionality and would rather you write your own separate program to do X". I've gotten that once or twice for stuff I thought was a no-brainer bugfix.)

recursive-include genshi *.py *.c *.txt *.html
recursive-include examples *
Expand Down
55 changes: 55 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[metadata]
name = Genshi
version = 0.8
description = A toolkit for generation of output for the web
long_description =
Genshi is a Python library that provides an integrated set of
components for parsing, generating, and processing HTML, XML or
other textual content for output generation on the web. The major
feature is a template language, which is heavily inspired by Kid.
author = Edgewall Software
author_email = info@edgewall.org
license = BSD
license_files = COPYING
url = https://github.com/edgewall/genshi
classifiers =
Development Status :: 4 - Beta
Environment :: Web Environment
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 3
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Text Processing :: Markup :: HTML
Topic :: Text Processing :: Markup :: XML
keywords =
python.templating.engines

[options]
# include tests for python3 setup.py test (needed when creating
# source distributions on python2 too so that they work on python3)
packages =
genshi
genshi.filters
genshi.template
genshi.tests
genshi.filters.tests
genshi.template.tests
genshi.template.tests.templates
install_requires =
six

[options.entry_points]
babel.extractors =
genshi = genshi.filters.i18n:extract[i18n]
python.templating.engines =
genshi = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin]
genshi-markup = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin]
genshi-text = genshi.template.plugin:TextTemplateEnginePlugin[plugin]

[options.extras_require]
i18n = Babel>=0.8
plugin = setuptools>=0.6a2
54 changes: 0 additions & 54 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,63 +98,9 @@ def zip_safe(self):
extra['include_package_data'] = True


# include tests for python3 setup.py test (needed when creating
# source distributions on python2 too so that they work on python3)
packages = [
'genshi', 'genshi.filters', 'genshi.template',
'genshi.tests', 'genshi.filters.tests',
'genshi.template.tests',
'genshi.template.tests.templates',
]


setup(
name = 'Genshi',
version = '0.8',
description = 'A toolkit for generation of output for the web',
long_description = \
"""Genshi is a Python library that provides an integrated set of
components for parsing, generating, and processing HTML, XML or
other textual content for output generation on the web. The major
feature is a template language, which is heavily inspired by Kid.""",
author = 'Edgewall Software',
author_email = 'info@edgewall.org',
license = 'BSD',
url = 'https://github.com/edgewall/genshi',

classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Processing :: Markup :: HTML',
'Topic :: Text Processing :: Markup :: XML'
],
keywords = ['python.templating.engines'],
packages = packages,
test_suite = 'genshi.tests.suite',
Copy link
Member

Choose a reason for hiding this comment

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

I don't recall if it's been discussed in this project yet, but the test command is deprecated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That should really be its own issue, and actually this coincides very well with the other mention here about reorganizing into a tests/ directory.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed -- let's leave messing with the test suite out of things for now.


install_requires = ['six'],
extras_require = {
'i18n': ['Babel>=0.8'],
'plugin': ['setuptools>=0.6a2']
},
entry_points = """
[babel.extractors]
genshi = genshi.filters.i18n:extract[i18n]

[python.templating.engines]
genshi = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin]
genshi-markup = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin]
genshi-text = genshi.template.plugin:TextTemplateEnginePlugin[plugin]
""",

ext_modules = ext_modules,
cmdclass = cmdclass,

Expand Down