Coder Social home page Coder Social logo

python-packaging-tutorial / python-packaging-tutorial Goto Github PK

View Code? Open in Web Editor NEW
64.0 64.0 24.0 3.96 MB

Tutorial on python packaging

Home Page: https://python-packaging-tutorial.readthedocs.io

License: Other

Python 86.44% CMake 2.33% Makefile 3.82% Batchfile 5.57% Shell 0.43% Cython 1.41%
building c-extension ci conda cpython cpython-extensions cross-platform packaging python scikit-build

python-packaging-tutorial's Introduction

python-packaging-tutorial

Tutorial on python packaging at SciPy 2018

Rendered notes here:

https://python-packaging-tutorial.readthedocs.io

Installation instructions

Windows

MacOS

Linux

Docker Image caching

  • run docker pull dockcross/manylinux-x64

Testing installation

  • Clone this repository
  • cd into the test_recipes folder
  • run conda build bitarray. Success is indicated by output like:
===== bitarray-0.8.1-py36h1de35cc_1 OK =====
import: 'bitarray'

Resource usage statistics from testing bitarray:
   Process count: 1
   CPU time: Sys=0:00:00.0, User=0:00:00.0
   Memory: 1.1M
   Disk usage: 16B
   Time elapsed: 0:00:02.0

TEST END: /Users/msarahan/miniconda3/conda-bld/osx-64/bitarray-0.8.1-py36h1de35cc_1.tar.bz2
Renaming work directory,  /Users/msarahan/miniconda3/conda-bld/bitarray_1529267981928/work  to  /Users/msarahan/miniconda3/conda-bld/bitarray_1529267981928/work_moved_bitarray-0.8.1-py36h1de35cc_1_osx-64_main_build_loop
# Automatic uploading is disabled
# If you want to upload package(s) to anaconda.org later, type:

anaconda upload /Users/msarahan/miniconda3/conda-bld/osx-64/bitarray-0.8.1-py36h1de35cc_1.tar.bz2

# To have conda build upload to anaconda.org automatically, use
# $ conda config --set anaconda_upload yes

anaconda_upload is not set.  Not uploading wheels: []
####################################################################################
Resource usage summary:

Total time: 0:00:36.9
CPU usage: sys=0:00:00.2, user=0:00:00.2
Maximum memory usage observed: 50.6M
Total disk usage observed (not including envs): 1016B


####################################################################################
creating 'dist/hello_cython-1.2.3-py3.5-macosx-10.9-x86_64.egg' and adding '_skbuild/setuptools/bdist.macosx-10.9-x86_64/egg' to it
removing '_skbuild/setuptools/bdist.macosx-10.9-x86_64/egg' (and everything under it)
Processing hello_cython-1.2.3-py3.5-macosx-10.9-x86_64.egg
Copying hello_cython-1.2.3-py3.5-macosx-10.9-x86_64.egg to /Users/msarahan/miniconda3/envs/skbuild/lib/python3.5/site-packages
Adding hello-cython 1.2.3 to easy-install.pth file

Installed /Users/msarahan/miniconda3/envs/skbuild/lib/python3.5/site-packages/hello_cython-1.2.3-py3.5-macosx-10.9-x86_64.egg
Processing dependencies for hello-cython==1.2.3
Finished processing dependencies for hello-cython==1.2.3
  • You're all set!

Troubleshooting

Package hosting service accounts

Pprior to attending the tutorial, participants should set up an account on

python-packaging-tutorial's People

Contributors

chrisbarker-noaa avatar henryiii avatar jcfr avatar jjhelmus avatar mkuzak avatar msarahan avatar ocefpaf avatar pythonchb avatar thewtex 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-packaging-tutorial's Issues

Format / tools for presentation, etc?

(I hope it's OK to use this repo for discussion and development of the tutorial)

What do we want to use to create the slides / materials for the tutorial?

I've had good luck with Sphinx and Hieroglyph -- Hieroglyph makes slides, and you also get a nice HTML page for folks to read -- not as good for presenting, but better for reading on your own.

Here's an example from my Python class:

http://uwpce-pythoncert.github.io/SystemDevelopment/packaging.html#packaging

Which is also my packaging talk, which may or may not be helpful when putting this together.

That is the regular html version, the slides version I don't have published, but the source is here:

https://github.com/UWPCE-PythonCert/SystemDevelopment/tree/master/slides_sources

If you have hieroglyph installed, you can simply "make slides" and get your html slides.

Test examples

All examples should be tested

Reference to command, code snippet could be integrated using literalinclude.

For example:

  .. literalinclude:: ../appveyor.yml
     :language: yaml
     :start-after: scikit-ci-yml.rst: start
     :end-before: scikit-ci-yml.rst: end
     :emphasize-lines: 2, 5, 8, 11

The start-after / start-before are optional, they allow to limit the focus on a section of a script. In this case, appveyor.yml

Help needed with conda-build and setting up meta.yaml, and setup.py for module/submodule structure.

Hello,

I am trying to build a conda package, using conda-build, from pure python modules (and submodules). As a starter I use the cookiecutter at https://github.com/conda/cookiecutter-conda-python.git.
If I understand correctly, one can only include python submodules if the source files are on github ?
Can someone please point me to a comprehensive example (even for a non professional programmer) on how to make a pure python package using conda-build, out of a simple module/submodule structure ?
To be more precise, I'm interested in how to set :

  • meta.yaml file (and how to use load_setup_py_data() function ?)
  • setup.py file.
    For further information : I manage creating a package from a local file where all my python code is in one file, but when I use the same approach on a git source (where I have only my python code in modules and submodules) , I get this error :

(%BUILD_PREFIX%) %SRC_DIR%>python setup.py install --single-version-externally-managed --record=record.txt
python: can't open file 'setup.py': [Errno 2] No such file or directory

Thanks

Move "Installation instructions" and "Testing installation" to website

  • Create sphinx_presentation/prerequisites.rst
  • Move the related content from README.md into prerequisites.rst file
    • Make sure to convert to use restructure text convention by looking at other *.rst file in the sphinx_presentation folder
    • Make sure to prevent the content added to prerequisites.rst from being included in the presentation slides.

Slides and website can be generated reading these instructions: sphinx_presentation/README.rst

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.