项目作者: jonpoveda

项目描述 :
Flint dependency injector from Pipenv for Python
高级语言: Python
项目地址: git://github.com/jonpoveda/pynjector.git
创建时间: 2018-05-15T07:54:23Z
项目社区:https://github.com/jonpoveda/pynjector

开源协议:GNU General Public License v3.0

下载


pynjector

Flit dependency injector from Pipenv for Python3

Usage

First of all, generate a python environment with Pipenv if you haven’t
got any and install pynjector:

  1. pipenv install
  2. pipenv install pynjector-0.1-py3-none-any.whl

and activate the environment:

  1. pipenv shell

As an script

Run the tool as an script:

  1. python pynjector/injector

You can add the argument -h to check for options.

As a module

Just import it in your python module or run it in your python shell:

  1. from pathlib import Path
  2. import pynjector
  3. deps = pynjector.parse_pipenv(Path('Pipfile.lock'))
  4. pynjector.inject(deps, Path('pyproject.toml'))

Note: no wheel is currently available online but you can build one
following the steps indicated in Building section

Developing

Clone this project and generate a python environment for developing with
Pipenv:

  1. pipenv install --dev

Packaging

Following PEP 518 recommendations, this project can be easily
build by using Flit, following this steps:

  • Update library version in src\__init__.py
  • In case of dependency changes, use injector to update pyproject.toml
    1. python pynjector/injector
  • Ask Flit to generate the wheel:
    1. flit build --format wheel
  • Check dist directory for the compiled library