GithubHelp home page GithubHelp logo

laktak / pipenv-shebang Goto Github PK

View Code? Open in Web Editor NEW
23.0 3.0 1.0 5 KB

shebang for pipenv scripts

Home Page: https://pypi.org/project/pipenv-shebang/

License: MIT License

Shell 23.98% Python 76.02%
pipenv shebang scripting

pipenv-shebang's Introduction

pipenv-shebang

pipenv-shebang allows you to put scripts in your path that run in a pipenv environment.

This solves the problem of launching pipenv run script.py from outside the script directory.

Usage

Put this shebang at the top of your script:

#!/usr/bin/env pipenv-shebang

You can also run your script with

pipenv-shebang /path/to/script

Installation

sudo pip install pipenv-shebang

# or
pip install --user pipenv-shebang

Updates

This project is stable. No updates are planned but that does not mean this project is stale, it is very much in use.

pipenv-shebang's People

Contributors

laktak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mijdavis2

pipenv-shebang's Issues

AUR Package for this Project

Hi!

I was wondering if there are plans to create an AUR Package Entry for this pip module?

If there are not, and you are not personally interested in doing such, I would glad to maintain the distribution of this package to the AUR.

You can reach me by reply here, or by email at [email protected].

Cheers!
Ryott

/usr/bin/env: ‘pipenv-shebang’: Not a directory

When replacing #!/usr/bin/env -S pipenv run python with #!/usr/bin/env pipenv-shebang, I am getting the error:

/usr/bin/env: ‘pipenv-shebang’: Not a directory

I am running into this issue on Ubuntu 18.04 in WSL on Windows.

> /usr/bin/env --version
env (GNU coreutils) 8.28

Windows support

I see that 089d7c1 added "multiplatform support" by installing a python script instead of a bash script when bash is not available.

This doesn't quite work on Windows by default, as the system does not know the extension-less pipenv-shebang file is executable.

The solution (also employed by pipenv itself) is apparently to rely on automatic script creation feature of setuptools (setup(entry_points={"console_scripts": ["pipenv-shebang = my_package.some_module:main_func"]})), which on Windows generates an exe file invoking the specified python function.

I guess this would involve changing pipenv-shebang to a proper python package instead of installing the scripts as data_files. After that the logical thing to do is to drop the bash script.

Do you agree with this solution?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.