Skip to content

Conversation

@jhermann
Copy link
Contributor

If you want more of those, I have a few in the queue…

@jhermann
Copy link
Contributor Author

BTW, the duplication of the stdlib directory in sys.path is curious, though not a real problem. Not sure what causes this.

@lorencarvalho
Copy link
Contributor

@jhermann this is awesome, thanks!! I'll try and get some eyes on this and your other PRs over the weekend.

And yeah, if you have more documentation to add, bring it on!!

Comment on lines +38 to +49
If you have ``coreutils`` with at least version 8.30 on your Linux system,
then you can use env shebangs *and* pass arguments to Python, like in this example:

.. code-block:: shell
shiv -p '/usr/bin/env -S python3 -I -S'
The magic ingredient is the new ``-S`` (split) option, but as of 2020
you have to target very new stable releases like Debian Buster
or rolling distributions for it to actually work.
Check for the option by calling ``env --help``.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we omit this entry for this change? I appreciate that we want to educate users about what is possible with shebangs, but given that the tool in question (shiv) has no opinion about the shebang, I'd rather not introduce this concept in our documentation.

and their deployment workflows.


Shipping Dependency Sets as a Single File
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about referring to these as "frozen environments" rather than "dependency sets". This is usually how we refer to them internally, but I want to know if it makes sense in the broader Python community.

Comment on lines +34 to +36
The ``-IS`` options in ``-p`` ensure this zipapp runs isolated (for increased security),
with neither the current working directory
nor the host's site packages in the Python path.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's omit this (and the flags) in the example, to not confuse users and discourage copy-pasted boilerplate.

Comment on lines +38 to +43
.. tip::

Replace the ``.`` at the end of the ``shiv`` call
by a literal list of PyPI packages,
or load them from a requirements file (``-r lib-requirements.txt``),
and you don't need an extra project for getting your base set defined.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good tip, can you call out the . earlier than this tip as well? I can imagine someone reading this doc may gloss right over the . on line 28 and be confused when they see this tip, but if you call it out (after the note about not providing an entry point, maybe) the reader will have proper context. Which is also a good opportunity to let them know that any non-shiv arguments/flags get delegated to pip.

Comment on lines +75 to +78
The underscore prefix in the zipapp name indicates this is not a command
humans would normally use – alternatively you can deploy into e.g.
``/usr/local/lib/python3.6/`` and then use an absolute path instead of
an ``env`` call in the script's shebang.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can omit this, don't want to overload the reader with info that's not critical.

Base automatically changed from master to main February 11, 2021 06:28
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.

2 participants