Skip to main content

beni

Code style: black Tests and style checks PyPi Package

Common names: Bolivian anaconda, Beni anaconda

Eunectes beniensis is a non-venomous boa species known only from the northeastern parts of Bolivia.

The four-metre long Eunectes beniensis was initially believed to be the result of hybridization between green and yellow anacondas, but was later determined to be a distinct species. The taxonomic status is not clear, due to lack of information and the appearance similarity to Eunectes notaeus. It is closely related to Eunectes notaeus and Eunectes deschauenseei.

beni is PEP 621/flit + conda

What?

This is a specific tool to fascilitate one workflow of using flit and conda together. The assumptions are:

  1. You have a repository with at least one Python package.
  2. You use PEP 621 and/or flit and pyproject.toml to describe your dependencies.
  3. You want to use Conda to manage local development but you wanna release your package on PyPi.
  4. You want to generate an environment.yml for local development that will install as many of your Pypi dependencies through Conda as possible.

Without this tool you have to manually keep your environment.yml up to date with all your pyproject.toml files, which is error prone and time consuming.

Unsolved issues

  1. What if the conda forge name is different than the pypi name? We should keep a list of these mappings.
  2. How do we use the pyproject.toml to automatically generate a conda forge recipe?
  3. In the future could conda just read from the pyproject.toml file in some way to create an environment out of it?

Usage

  1. pip install beni
  2. Run beni <path to pyproject.toml> [<another path to pyproject.toml>] > binder/environment.yml to generate an environment file. It adds all your requirements that are conda forge packages to this environment and names it after the first pyproject.toml module. each of your requirements to see if there is an equivalent conda forge package
  3. Add conda env create -f bind/environment.yml && conda activate <module name> && flit install --symlink to your README as the dev setup.

Example

$ beni -h
usage: beni [-h] [--deps {all,production,develop,extras}] [--extras extra1,...]
            [--ignore [foo [bar ...]]]
            pyproject.toml [pyproject.toml ...]

Generate an environment.yml.

positional arguments:
  pyproject.toml        flit config files

optional arguments:
  -h, --help            show this help message and exit
  --deps {all,production,develop,extras}
                        Which dependencies to emit. 'production' means no extras,
                        'develop' means the extras 'test', 'doc', and 'dev', 'all' means all extras,
                        and 'extras' means the ones specified in `--extras` or all extras if `--extras` is not given.
  --extras extra1,...   Install the dependencies of these (comma separated) extras additionally to the ones
                        implied by --deps. --extras=all can be useful in combination with --deps=production.
  --ignore [foo [bar ...]]
                        Conda packages to ignore

$ cat pyproject.toml
[tool.flit.metadata]
requires = [
    "typing_extensions",
    "typing_inspect",
    "python-igraph=0.8.0"
]
requires-python = ">=3.7"
[tool.flit.metadata.requires-extra]
test = [
    "pytest",
    "pytest-cov",
    "pytest-mypy",
    "pytest-randomly",
    "pytest-xdist",
    "pytest-testmon",
    "pytest-pudb",
    "mypy"
]
doc = [
    "sphinx",
    "sphinx-autodoc-typehints",
    "sphinx_rtd_theme",
    'recommonmark',
    "nbsphinx",
    "ipykernel",
    "IPython",
    "sphinx-autobuild"
]
dev = [
    "jupyterlab>=1.0.0",
    "nbconvert",
    "pudb"
]

$ beni pyproject.toml
name: metadsl
channels:
  - conda-forge
dependencies:
  - python>=3.7
  - pip
  - pip:
    - flit
  - typing_extensions
  - typing_inspect
  - python-igraph=0.8.0
  - pytest
  - pytest-cov
  - pytest-mypy
  - pytest-randomly
  - pytest-xdist
  - pytest-testmon
  - pytest-pudb
  - mypy
  - jupyterlab>=1.0.0
  - nbconvert
  - pudb

Development

conda env create -f environment.yml
conda activate beni
pre-commit install
flit install --symlink

Metadata

Release files for beni 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beni 0.4.4
File Size Uploaded
beni-0.4.4.tar.gz 8.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beni 0.4.4
File Interpreter ABI Platform
beni-0.4.4-py3-none-any.whl Python 3 none any Details

Total release size: 15.5 kB

Release files / beni-0.4.4.tar.gz

Download URL beni-0.4.4.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cb33ca22546518e69e273cbbb54958e8ae924f20b65a5bb27e3877aaee815c54
BLAKE2b-256 checksum
How to use checksums
276d4781e65914fde679cccd9982c66516fd11e67bde2d3dbfecd5bb764c9d0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.26.0

Release files / beni-0.4.4-py3-none-any.whl

Download URL beni-0.4.4-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2334b1d5b1a20751bb5265ce6f7ab56ed284cc4447b6f44f21b20617b05b1842
BLAKE2b-256 checksum
How to use checksums
aab900457776eeb814219c7a80e4e281009c8528c3bad28442cbdede557fe3f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.26.0

Release history Release notifications | RSS feed

This release

0.4.4 This release

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page