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

"parse_requirements() missing 1 required keyword argument", #12

Closed
luckypoem opened this issue Jul 26, 2016 · 8 comments
Closed

"parse_requirements() missing 1 required keyword argument", #12

luckypoem opened this issue Jul 26, 2016 · 8 comments
Assignees

Comments

@luckypoem
Copy link

hi.

root@AR:/widely# pip install -r requirements.txt
root@AR:
/widely# ls
build_docs LICENSE.md MANIFEST.in README.md README.rst requirements.txt setup.py widely
root@AR:/widely# python setup.py install
Traceback (most recent call last):
File "setup.py", line 14, in
requirements = [str(ir.req) for ir in install_requirements]
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_file.py", line 79, in parse_requirements
"parse_requirements() missing 1 required keyword argument: "
TypeError: parse_requirements() missing 1 required keyword argument: 'session'
root@AR:
/widely#

how to fix it?

@kmarekspartz
Copy link
Owner

Thanks! This looks like an API change in parse_requirements since I last took a look at this. This looks similar to brettcannon/caniusepython3#72. Want to make an attempt at this? It looks like it would be the similar to the fix from that issue: Clever/kayvee-python@ebec3ff

I can bump version and release it if you'd like.

@luckypoem
Copy link
Author

hi.
i'm a novice.pls release a fixed version.
tks

@kmarekspartz
Copy link
Owner

No problem with being a novice! I think this is within your abilities. I look forward to reviewing a PR.

@luckypoem
Copy link
Author

hi.

i made some modifications to setup.py,but it doesn't work:

root@AR:~/widely# cat setup.py
import os

from setuptools import setup, find_packages
from pip.req import parse_requirements, PipSession

basedir = os.path.dirname(file)
requirements_path = os.path.join(basedir, 'requirements.txt')

parse_requirements() returns generator of pip.req.InstallRequirement objects

install_requirements = parse_requirements(requirements_path), session=PipSession()

Convert to setup's list of strings format:

requirements = [str(ir.req) for ir in install_requirements]

setup(
name='widely',
version='0.15',
description='Static Site as a Service using AWS S3',
long_description=open('README.rst').read(),
author='Kyle Marek-Spartz and Michael Burling',
author_email='[email protected]',
py_modules=['widely'],
url='http://www.celador.mn/widely',
include_package_data=True,
packages=find_packages(exclude=['tests*']),
install_requires=requirements,
entry_points={
'console_scripts': [
'widely = widely:main',
],
},
test_suite='nose.collector',
classifiers=["Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 2 :: Only",
"Topic :: Internet",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Site Management",
"Topic :: Utilities"],
license='MIT'
)
root@AR:/widely#
root@AR:
/widely# python setup.py install
File "setup.py", line 11
install_requirements = parse_requirements(requirements_path), session=PipSession()
SyntaxError: can't assign to function call
root@AR:~/widely#

@luckypoem
Copy link
Author

so can u just update setup.py file?

@kmarekspartz kmarekspartz self-assigned this Jul 26, 2016
kmarekspartz added a commit that referenced this issue Jul 26, 2016
parse_requirements needs a session. Fixes #12
@kmarekspartz
Copy link
Owner

Version 0.16 has been uploaded to PyPI.

@luckypoem
Copy link
Author

hi.
this time i can run "pip install widely" successfully.but i don't have a amazon aws.

is it possible to use widely in a common linux vps?
how to use widely in a common linux vps?

@kmarekspartz
Copy link
Owner

No, widely is not for deploying to a VPS.

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

2 participants