GithubHelp home page GithubHelp logo

pombredanne / python-appveyor-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ogrisel/python-appveyor-demo

0.0 1.0 0.0 60 KB

Demo project for building Python wheels with appveyor.com

License: Creative Commons Zero v1.0 Universal

PowerShell 63.76% Batchfile 29.83% Python 6.41%

python-appveyor-demo's Introduction

python-appveyor-demo

Demo project for building Windows Python wheels using http://appveyor.com. It supports both Python 2 and 3 on 32 and 64 bit architectures.

AppVeyor is a continuous integration platform similar to travis-ci.org but for the Windows platform. AppVeyor is free for Open Source projects and runs on the Microsoft Azure cloud infrastructure.

This sample Python project has a simple C compiled extension (statically generated from a Cython source file in this case). The build itself is configured by in the setup.py file.

This project is meant to document a minimalistic yet working example to help other Python project maintainers.

Continuous integration setup with AppVeyor

The appveyor.yml file in this repo configures a Windows build environment for both for 32 bit and 64 bit Python compiled extensions. This demo project is configured to trigger build jobs at:

http://ci.appveyor.com/project/ogrisel/python-appveyor-demo

In particular:

  • the appveyor/install.ps1 powershell script downloads and installs Python and and pip to grab all the development dependencies of the project as registered in the dev-requirements.txt file.

  • the appveyor/run_in_env.cmd batch script configures environment variables to activate the MSVC++ compiler from the Windows SDK matching the Python version and architecture.

The content of the dist/ folder (typically hosting the generated .whl packages) is archived in the build report (see previous link).

Note: it is possible to activate the "Rolling builds" option to automatically cancel build on intermediate push events to avoid clogging the build queue with useless jobs. However it can be problematic as it can cancel builds triggered by direct push to master outside of any PR. Instead the appveyor.yml file of this repo uses a specific powershell snippet to quickly fail if a newer build is queued for the same PR.

Building and testing locally from source

Here are the instructions to replicate the build steps manually.

Install developer dependencies (only nose and wheel at this time):

pip install -r dev-requirements.txt

You can then build with:

python setup.py sdist bdist_wheel

The generated source tarball and platform specific .whl package can be found in the dist subfolder.

Install the .whl package with with:

pip install dist/python_appveyor_demo-1.0-*.whl

Finally run the tests (from any folder by the source tree):

nosetests -v pyappveyordemo

Under Windows will need a Windows SDK to build the compiled extension with the MSVC++ compilers. See the following for details:

https://github.com/cython/cython/wiki/CythonExtensionsOnWindows

Credits

Thanks to Feodor Fitsner (@FeodorFitsner) from AppVeyor for the fast support and for installing the old versions of the Windows SDK required to build Python projects.

Thanks to Thomas Conté (@tomconte) from Microsoft for your help in scripting Windows SDKs and MSVC build environments usage.

python-appveyor-demo's People

Contributors

hickford avatar jayvdb avatar moreati avatar nedbat avatar ogrisel avatar orthographic-pedant avatar pombredanne 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.