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

setuptools - ValueError: Newlines are not allowed #67

Open
michael-lazar opened this issue Nov 15, 2021 · 2 comments
Open

setuptools - ValueError: Newlines are not allowed #67

michael-lazar opened this issue Nov 15, 2021 · 2 comments

Comments

@michael-lazar
Copy link

Greetings!

It looks like with the newest release of setuptools this package is now failing to install. The issue is that there's a newline in the package description which is no longer permitted by setuptools.

pypa/setuptools#1390

https://github.com/venmo/business-rules/blob/master/setup.py#L15

python3.8 -m pip show setuptools
Name: setuptools
Version: 59.0.1
Summary: Easily download, build, install, upgrade, and uninstall Python packages
Home-page: https://github.com/pypa/setuptools
Author: Python Packaging Authority
Author-email: distutils-sig@python.org
License: UNKNOWN
Location: /usr/local/lib/python3.8/site-packages
Requires:
Required-by: check-manifest
python3.8 -m pip install business-rules==1.0.1
Collecting business-rules==1.0.1
  Using cached business-rules-1.0.1.tar.gz (13 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python@3.8/bin/python3.8 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qm/qnlxs5yj14vf2x5k94vrd10m0000gn/T/pip-install-05q8s9vi/business-rules_19d9ce7311f243dc8d21bd4d97ec02d0/setup.py'"'"'; __file__='"'"'/private/var/folders/qm/qnlxs5yj14vf2x5k94vrd10m0000gn/T/pip-install-05q8s9vi/business-rules_19d9ce7311f243dc8d21bd4d97ec02d0/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/qm/qnlxs5yj14vf2x5k94vrd10m0000gn/T/pip-pip-egg-info-68fyu19n
         cwd: /private/var/folders/qm/qnlxs5yj14vf2x5k94vrd10m0000gn/T/pip-install-05q8s9vi/business-rules_19d9ce7311f243dc8d21bd4d97ec02d0/
    Complete output (26 lines):
    running egg_info
    creating /private/var/folders/qm/qnlxs5yj14vf2x5k94vrd10m0000gn/T/pip-pip-egg-info-68fyu19n/business_rules.egg-info
    writing /private/var/folders/qm/qnlxs5yj14vf2x5k94vrd10m0000gn/T/pip-pip-egg-info-68fyu19n/business_rules.egg-info/PKG-INFO
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/qm/qnlxs5yj14vf2x5k94vrd10m0000gn/T/pip-install-05q8s9vi/business-rules_19d9ce7311f243dc8d21bd4d97ec02d0/setup.py", line 12, in <module>
        setuptools.setup(
      File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/Cellar/python@3.8/3.8.11/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/Cellar/python@3.8/3.8.11/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/local/Cellar/python@3.8/3.8.11/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 292, in run
        writer(self, ep.name, os.path.join(self.egg_info, ep.name))
      File "/usr/local/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 656, in write_pkg_info
        metadata.write_pkg_info(cmd.egg_info)
      File "/usr/local/Cellar/python@3.8/3.8.11/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 1117, in write_pkg_info
        self.write_pkg_file(pkg_info)
      File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line 167, in write_pkg_file
        write_field('Summary', single_line(self.get_description()))
      File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line 151, in single_line
        raise ValueError('Newlines are not allowed')
    ValueError: Newlines are not allowed
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/44/b1/5aa6d81111e701e83917ee4b16ac8882c2c4dfde57af4013f1f97a2175ac/business-rules-1.0.1.tar.gz#sha256=e0f58104df937378856e8199a49af4f5b4dbe5ac21b863a080810dedc3326d1d (from https://pypi.org/simple/business-rules/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement business-rules==1.0.1 (from versions: 0.1, 0.1.1, 0.1.2, 0.1.3, 0.2.0, 1.0.1)
ERROR: No matching distribution found for business-rules==1.0.1

The issue can be worked around by downgrading to setuptools==58.5.3.

@MiguelSmith
Copy link

Yep, was about to create the issue myself. Can confirm that this is the source of the issue as well as the fix.

@mblayman
Copy link

With the revert from setuptools (pypa/setuptools#2893), this package is safe to install again. I do think it would be valuable to merge #68 still.

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

No branches or pull requests

3 participants