GithubHelp home page GithubHelp logo

devopskev / bazel-python-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from erain/bazel-python-example

0.0 1.0 0.0 50.35 MB

Python 96.51% Shell 0.08% C 1.22% C++ 1.05% Makefile 0.31% Batchfile 0.01% HTML 0.59% CSS 0.01% Roff 0.13% DTrace 0.01% Visual Basic 0.01% PLSQL 0.09%

bazel-python-example's Introduction

Introduction

Following commands show how to use this repo with bazel's py_runtime rule.

Use the system-wide python interpreter.

$ bazel run :bin
INFO: Analysed target //:bin (8 packages loaded).
INFO: Found 1 target...
Target //:bin up-to-date:
  bazel-bin/bin
INFO: Elapsed time: 3.168s, Critical Path: 0.02s
INFO: Build completed successfully, 4 total actions

INFO: Running command line: bazel-bin/bin
*****************************************
* The Python version running is : 2.7.6 *
*****************************************

Use a python interpreter in an absolute path:

$ bazel run --python_path=/home/yiyu/.pyenv/versions/2.7.12/bin/python :bin
INFO: Analysed target //:bin (0 packages loaded).
INFO: Found 1 target...
Target //:bin up-to-date:
  bazel-bin/bin
INFO: Elapsed time: 0.272s, Critical Path: 0.01s
INFO: Build completed successfully, 2 total actions

INFO: Running command line: bazel-bin/bin
*****************************************
* The Python version running is : 2.7.12 *
*****************************************

Use py_runtime with interpreter_path which points to an absolute path

$ bazel run --python_top=//:python-2 :bin
INFO: Analysed target //:bin (0 packages loaded).
INFO: Found 1 target...
Target //:bin up-to-date:
  bazel-bin/bin
INFO: Elapsed time: 0.253s, Critical Path: 0.01s
INFO: Build completed successfully, 2 total actions

INFO: Running command line: bazel-bin/bin
*****************************************
* The Python version running is : 2.7.11 *
*****************************************

Use py_runtime with interpreter which is a checked-in python interpreter

$ bazel run --python_top=//:python-3 :bin
INFO: Analysed target //:bin (0 packages loaded).
INFO: Found 1 target...
Target //:bin up-to-date:
  bazel-bin/bin
INFO: Elapsed time: 4.063s, Critical Path: 0.50s
INFO: Build completed successfully, 4 total actions

INFO: Running command line: bazel-bin/bin
*****************************************
* The Python version running is : 3.7.0a0 *
*****************************************

bazel-python-example's People

Contributors

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