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

Package into single file with stickytape #70

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

alexmojaki
Copy link
Collaborator

Closes #67

Under single_file, run package.sh to update single_file_icecream.py. Not sure if/how we'd want to automate this, e.g. with travis or git commit hooks, and I don't want to go there.

@gruns
Copy link
Owner

gruns commented Apr 2, 2021

should we create a dist/ directory where the single_file_icecream.py file would live?

another alternative would be to create a release, as in gh releases (https://github.com/gruns/icecream/releases) with the single file icecream.py

since users arent installing single file icecream.py through pip, the file just needs to be hosted somewhere for download. gh releases, and/or a dist/ directory, seems the best place to me

@alexmojaki
Copy link
Collaborator Author

It's no longer one file, it's a file for each version. And there's already a directory. Maybe call it single_file_dist?

@gruns
Copy link
Owner

gruns commented Apr 2, 2021

afaict there is, unfortunately, no way to release just a file through github releases. only archives (.zip, .tar.gz)

and yep -- dist/ exists already but it's only used for packaging for pypi and isnt checked into the repo

we could change that and replace the blanket dist/ rule in .gitignore with

dist/*.whl
dist/*.zip
dist/*.tar.gz

and then write the single file icecream.py into dist/, which would then be checked in. or, like you said, create a new single-file-import/ directory

is there an prior art or de facto standard here for how projects that use stickytape distribute the generated single py files?

another option: sidestep all this and just add instructions to the readme along the lines of: 'want a single file to import? check out the repo, pip install stickytape, and run generate-single-file.sh'. that's the lowest hanging fruit.

im ok with that for now. see if that suffices and only if it doesnt, iterate and build something better

@salabim
Copy link

salabim commented Apr 2, 2021

Or add a comment "If you want a single source file IceCream-like package, consider ycecream.". Really just one file for all Python versions (2.5, 3.6++) and installable from with pip.

@alexmojaki
Copy link
Collaborator Author

and yep -- dist/ exists already

No I meant that the files already live in a directory called single_file which I suggested renaming to single_file_dist. I don't think there should be two directories for this purpose, nor do I think the other scripts should move to the root.

is there an prior art or de facto standard here for how projects that use stickytape distribute the generated single py files?

I doubt it.

another option: sidestep all this and just add instructions to the readme along the lines of: 'want a single file to import? check out the repo, pip install stickytape, and run generate-single-file.sh'. that's the lowest hanging fruit.

The point is that some people have trouble pip installing.

@alexmojaki
Copy link
Collaborator Author

Or add a comment "If you want a single source file IceCream-like package, consider ycecream.". Really just one file for all Python versions (2.5, 3.6++) and installable from with pip.

2.5?

@salabim, your spammy comments are becoming excessive. Please tone it down so I'm not tempted to delete or report your comments. @gruns, do you feel similarly?

@gruns
Copy link
Owner

gruns commented Apr 2, 2021

The point is that some people have trouble pip installing.

it's a safe assumption, to me, that any python dev should have access to pip during development, though

it'd be during deployment/packaging/bundling that they want to avoid pip and instead import icecream via a single file

so generating said single file icecream.py with a dependency installed via pip (stickytape) seems fine to me. and it's definitely simpler than having to remember to generate single file versions of icecream.py on every commit or release. ie

Not sure if/how we'd want to automate this, e.g. with travis or git commit hooks, and I don't want to go there.

which i agree with; not worth going down that road yet

besides, is stickytape self-hosting and it generates a single file version of itself for use on systems without pip? then no pip required 😉 /s

@gruns
Copy link
Owner

gruns commented Apr 2, 2021

@salabim, your spammy comments are becoming excessive. Please tone it down so I'm not tempted to delete or report your comments. @gruns, do you feel similarly?

agreed. @salabim ycream is great and youve built many great things there

but the best path is if you can take some of those great features and merge them into icecream. we'll go farther together

either way, please tone it down ❤️

@alexmojaki
Copy link
Collaborator Author

The point is that some people have trouble pip installing.

it's a safe assumption, to me, that any python dev should have access to pip during development, though

Maybe, I'm not sure.

In any case, that's quite a bit of work to put on a user for a package whose selling point is largely typing a few less characters.

having to remember to generate single file versions of icecream.py on every commit or release. ie

Not sure if/how we'd want to automate this, e.g. with travis or git commit hooks, and I don't want to go there.

which i agree with; not worth going down that road yet

Since it's already in tox now, I think the way forward is:

  1. Make a script that releases on pypi
  2. Run tox in that script, always good to have that safety anyway
  3. Have tox generate single files like it does now, but based on a switch like an environment variable rather than uncommenting
  4. Turn that switch on in the releasing script

That shouldn't be too bad.

besides, is stickytape self-hosting and it generates a single file version of itself for use on systems without pip? then no pip required /s

haha it should be!

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

Successfully merging this pull request may close these issues.

Package into a single file
3 participants