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

Upload to pypi #5

Open
steven-murray opened this issue Dec 6, 2013 · 4 comments
Open

Upload to pypi #5

steven-murray opened this issue Dec 6, 2013 · 4 comments

Comments

@steven-murray
Copy link

Hi there,

I was just wondering if there were any plans on getting this up on pypi? It would be nice to be able to install it via pip install. I have also been adding a few changes to the setup script -- a few months ago I sent a pull request but nothing has been done about it?

Cheers,
Steven

@joezuntz
Copy link
Owner

joezuntz commented Dec 6, 2013

Hi Steven,

Sorry about forgetting the pull request! It looked v useful and I did mean to merge it. I will have a look now!

I'm a bit wary about putting it on pypi as it sort of implies that it is production quality, when I'm not really sure if that's the case as I've never done really proper validation checks (though obviously I do think it works!)

Joe

@steven-murray
Copy link
Author

Hi Joe,

No worries. With the removal of the automatic download it wouldn't be that useful anyway. I think if it was versioned something like 0.1.0 then people would recognise it as not truly production quality anyway so that would be okay (in my opinion), but if you have to download the CAMB archive manually into the pycamb folder, then it would be easier for people to download pycamb to a more manageable location themselves rather than 'pip'ing it.

I wonder if there is some way around this... (that Antony would approve of)

@steven-murray
Copy link
Author

Hmmm,

Just thinking about it now. I am using this as a part of my project hmf, python code for the Halo Mass Function. I would like this to be as easy to install as possible... hopefully just "pip install hmf". However, since pycamb is a dependency, it will have to be installed in this annoying manual way.

This is compounded by the fact that I use this on a server as a backend for my hmfcalc web-app. On the server I really don't want to have to faff around with web-browsers etc. I don't mind having to read a license and press enter or type "yes" or whatever, but no more than that if at all possible.

But I really don't know how we could get around having the URL freely displayed in the shell file as you did. Surely there is some way to make everyone happy...

@steven-murray
Copy link
Author

I have somewhat of a solution. While we can't make the download completely open, we can assume that if someone knows the download url then they must have gone through the "correct" process to get it. So I thought we could add something like this:

# Look in sys.argv for a url to get CAMB from (we can't use the url here
# because of licensing).
for arg in sys.argv:
    if arg.startswith("--get="):
        url = arg[6:]

sys.argv.remove("--get=" + url)

fname = url.split("/")[-1]

# Get CAMB, untar and copy *.[fF]90 to src/
call(["wget", url])
call(["tar", "-xzvf", fname])
call(["rm", fname])

Then notify people in the readme that they can add this argument to make things more automatic.

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