GithubHelp home page GithubHelp logo

Usage with different python versions about pickley HOT 3 OPEN

naphta avatar naphta commented on September 24, 2024
Usage with different python versions

from pickley.

Comments (3)

zsimic avatar zsimic commented on September 24, 2024

pickley currently defaults to system python, but can install/package with any python.

Which python to use can be specified via command line: pickley --python 3.6 install ... (or -P for short). Value for --python can be:

  • full path to a python installation, like for example /usr/bin/python
  • command name like python2.7 or python3
  • short form like py3.6 of 3.6 or even just 36
  • you can also be more specific like 3.7.3

A config file can also be provided in <base>/.pickley/config.json (example if you dropped pickley in ~/.local/bin: ~/.local/bin/.pickley/config.json).

Example config:

{
  "python_installs": "~/.local/pyenv/versions",
  "python": {
    "3.7": "awscli"
  },
}

The above example would tell pickley to look at ~/.local/pyenv/versions for python installations (in addition to what you already have on $PATH).
Then default to 3.7 for awscli (if no --python specified).

I plan to provide better support for this:

  • respect module's python_requires (if there's any), don't default to system python for everything
  • document how python versions are found :)
  • see what's the best way out there people are getting their "clean python" installations, and see if it could be made to work with as little configuration as possible :)

Few examples (without config):

pickley -P3.7 install tox
pickley -P `which python3` install tox
pickley -P ~/.local/pyenv/versions/3.7.3 install tox

from pickley.

naphta avatar naphta commented on September 24, 2024

@zsimic Great answer thank you.

In that example configuration above for pointing the default installation to pyenv would that be a good idea for doing by default? Just do a quick check for pyenv if it's installed; if so default to it?

If that is a simple enough thing to do I don't mind opening up a feature branch / pull request to add that feature.

from pickley.

zsimic avatar zsimic commented on September 24, 2024

Yes, that would make sense to do I think, as pyenv is pretty popular.
Didn't do it yet as I tried to keep it simple and reach 100% test coverage first.

Next things I plan to do are (in this order):

  • fix edge case around dashes vs underscores in package names (currently broken: you can't install foo-bar, have to manually state it as foo_bar...)
  • provide an upgrade command (accepting 0 or more args)
  • write a good documentation
  • respect python_requires if package specifies one (so not to have to configure anymore)
  • fancier python search (so stuff like auto-detect pyenv)

Contributions absolutely welcome! :)

from pickley.

Related Issues (3)

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.