Giter VIP home page Giter VIP logo

pep517's Introduction

PEP 517 specifies a standard API for systems which build Python packages.

This package contains wrappers around the hooks specified by PEP 517. It provides:

  • A mechanism to call the hooks in a subprocess, so they are isolated from the current process.
  • Fallbacks for the optional hooks, so that frontends can call the hooks without checking which are defined.
  • Functions to load the build system table from pyproject.toml, with optional fallback to setuptools.

Run the tests with pytest or tox.

Usage:

import os
from pep517 import Pep517HookCaller
from pep517.pyproject import load_system

src = 'path/to/source'  # Folder containing 'pyproject.toml'
build_sys = load_system(src)

print(build_sys['requires'])  # List of static requirements

hooks = Pep517HookCaller(
    src, 
    build_backend=build_sys['build_backend'],
    backend_path=build_sys.get('backend-path'),
)

config_options = {}   # Optional parameters for backend
# List of dynamic requirements:
print(hooks.get_requires_for_build_wheel(config_options))

destination = 'also/a/folder'
whl_filename = hooks.build_wheel(destination, config_options)
assert os.path.isfile(os.path.join(destination, whl_filename))

The caller is responsible for installing build dependencies. The static requirements should be installed before trying to call any hooks.

The buildtool_demo package in this repository gives a more complete example of how to use the hooks. This is an example, and doesn't get installed with the pep517 package.

pep517's People

Contributors

chrahunt avatar duckinator avatar encukou avatar jaraco avatar pfmoore avatar pradyunsg avatar sbidoul avatar takluyver avatar

Watchers

 avatar  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.