Code Monkey home page Code Monkey logo

python's Introduction

python

A Python 3 framework that currently installs to /Library/ManagedFrameworks/Python/Python3.framework.

Please see Apple's documentation on file system basics for more information on the thought process here.

This is an intended replacement for when Apple removes /usr/bin/python

Using interactively

After installing any of the packages, a symbolic link can be used within terminal for interactive Python sessions. At the time of this writing /usr/local/bin/managed_python3 points to /Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/bin/python3

Using with scripts

It is currently recommended to point directly to symbolic link provided by the Python framework.

At the time of this writing /Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/bin/python3 points to /Library/ManagedFrameworks/Python/Python3.framework/Versions/3.8/bin/python3.8

An example script would look like the following:

#!/Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/bin/python3

print('This is an example script.')

Other options to consider

zshenv global alias

If you are calling python within zsh scripts, adding a global alias to /etc/zshenv may be appropriate.

alias -g python3.framework='/Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/bin/python3'

For more information on this method, please see Armin Briegel's "Moving to Zsh" Part II and IV

Notes

To decrease complexity, only a single package may be installed at any given time on a machine.

Upgrades

While Python itself has its own update cadence and dot release schedule, it is likely that this package will have many updates as 3rd party libraries release their own updates, bug fixes and security enhancements. These packages should not break your workflow, but you should test your scripts prior to wide deployment to your devices.

Downgrades

Downgrades will not be supported by this repository.

pip

While pip is bundled in this framework, it is not recommended to install any external libraries into your frameworks folder outside of what comes with the package. If you need to use or test external libraries not present in the package, it is recommended to use a virtual environment or a tool like pyenv.

Pull requests can be issued to the opinionated or recommended packages, but more scrutiny will be applied to the recommended package.

Flavors of Python

We currently offer four versions of Python. You can chose which version suits your needs.

No Customization

This is a Python.framework that contains everything from the official Python package and nothing more.

Many open source tools will not work with this, but it may be helpful for development purposes.

Minimal

This is a Python.framework that includes xattr and PyObjc - the original intent of Relocatable Python.

Tools that should work when using the "Minimal Flavor":

Recommended

This is a Python.framework that contains everything from "Minimal", and a few libraries that various well-known open source projects require.

Tools that should work when using the "Recommended Flavor":

Opinionated

This is a Python.framework that contains everything from "Recommended", and libraries that various open source projects require.

This is a kitchen sink approach, opting for the latest known packages.

Tools that should work when using the "Opinionated Flavor":

Updating packages

This should be done in a clean virtual environment. After every Python package install, you can run pip freeze | xargs pip uninstall -y to cleanup the environment.

CI Job

To update the certificate, run base64 -i /path/to/certificate.p12 -o base64string and import that into the github secrets store and update the password secret as well.

Credits

These packages are created with two other open source tools:

Both are written by Greg Neagle. Thank you for your continued dedication to the macOS platform.

python's People

Contributors

asemak avatar chefaustin avatar dependabot[bot] avatar erikng avatar gmarnin avatar gregneagle avatar homebysix avatar natewalck avatar vmiller avatar

Watchers

 avatar

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.