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

Unable to pip install ckan #4271

Closed
rossjones opened this issue Jun 4, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@rossjones
Copy link
Collaborator

commented Jun 4, 2018

CKAN Version if known (or site URL)

2.8.0

$ pip --version
10.0.1

Please describe the expected behaviour

I tried pip install ckan so that my linter would stop complaining (my actual ckan is in a VM) and I expected it to install CKAN.

Please describe the actual behaviour

It appears that requirement-setuptools.txt is not part of the pypi package.

 File "<string>", line 1, in <module>
      File "/private/tmp/pip-install-eaBfYZ/ckan/setup.py", line 31, in <module>
        with open(os.path.join(HERE, 'requirement-setuptools.txt')) as f:
    IOError: [Errno 2] No such file or directory: '/private/tmp/pip-install-eaBfYZ/ckan/requirement-setuptools.txt'

What steps can be taken to reproduce the issue?

Try running pip install ckan

@rossjones

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 4, 2018

I worked around this by downloading https://files.pythonhosted.org/packages/70/aa/b76a115c256b9cd3ccfe166e04949f0b1dcbde36133025f97535c1a8b942/ckan-2.8.0.tar.gz extracting and tweaking the setup.py to remove the requirement-setuptool check. I might as well have installed from source :(

It is possible to specify the setup tools dependency in the setup.py instead of a separate file?

@amercader amercader self-assigned this Jun 5, 2018

@amercader

This comment has been minimized.

Copy link
Member

commented Jun 5, 2018

This should do the trick to include the file in the packaged version:

diff --git a/MANIFEST.in b/MANIFEST.in
index 37e122f..6f606ae 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -19,4 +19,4 @@ include CHANGELOG.txt
 include ckan/migration/migrate.cfg
 include ckan/migration/README
 recursive-include ckan/migration/versions *.sql
-recursive-include ckan_deb *
+include requirement-setuptools.txt

We don't really test installing via pip install ckan but if it helps feel free to send a PR with the change. If I'm not mistaken this won't install the requirements either, what's your use case @rossjones ?

rossjones added a commit to servercode/ckan that referenced this issue Jun 6, 2018

Include requirement-setuptools.txt in manifest
When attempting to `pip install ckan` it fails as the setup.py requires
the requirement-setuptools.txt to be present, and it is not.  This
change makes sure that the pip install will not fail due to the absence
of this file.

This PR does not include the requirements.txt as this would likely
require further discussion about how requirements are loaded.

Fixes ckan#4271
@rossjones

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 6, 2018

PR sent. I have a few particular use-cases:

  • When working in a VM, my editor's linter will not work unless it can import ckan.plugins.toolkit. I'd rather just pip install CKAN so that it be can loaded locally by my editor.

  • When working on an extension, that doesn't require me to make changes to CKAN, I'd rather pip install CKAN rather than do a source install.

The second case isn't solved by my PR because it involves also having the requirements.txt included so that it can be installed at the same time. But I thought there'd likely need to be a much longer discussion about requirements and didn't want to delay getting my linter working when 2.8.1 is eventually ready.

rossjones added a commit to servercode/ckan that referenced this issue Jun 6, 2018

Include requirement-setuptools.txt in manifest
When attempting to `pip install ckan` it fails as the setup.py requires
the requirement-setuptools.txt to be present, and it is not.  This
change makes sure that the pip install will not fail due to the absence
of this file.

This PR does not include the requirements.txt as this would likely
require further discussion about how requirements are loaded.

Fixes ckan#4271

tino097 added a commit that referenced this issue Jul 20, 2018

Include requirement-setuptools.txt in manifest
When attempting to `pip install ckan` it fails as the setup.py requires
the requirement-setuptools.txt to be present, and it is not.  This
change makes sure that the pip install will not fail due to the absence
of this file.

This PR does not include the requirements.txt as this would likely
require further discussion about how requirements are loaded.

Fixes #4271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.