Giter Site home page Giter Site logo

basnijholt / unidep Goto Github PK

View Code? Open in Web Editor NEW
217.0 5.0 5.0 645 KB

Single source of truth with requirements for pip and conda

Home Page: https://unidep.readthedocs.io

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
conda conda-environment conda-lock pip pip-compile setuptools

unidep's Issues

FAQ

  • How is this different from conda/mamba/pip?
  • When to use this? Internal projects, in research and data science.
  • You prefer to install packages with conda but still want your package to be pip installable
  • You're tired of keeping your requirements.txt and environment.yaml in sync
  • You want a ultra low effort full development environment setup
  • I found a project using unidep, now what?

When to use?

  • You prefer to install packages with conda but still want your package to be pip installable
  • You're tired of keeping your requirements.txt and environment.yaml in sync
  • You want a ultra low effort full development environment setup

Install local packages and their dependencies in one go

Instead of in two steps:

unidep/unidep/_cli.py

Lines 479 to 520 in 9afbaad

if not skip_local:
for file in files:
if is_pip_installable(file.parent):
installable.append(file.parent)
else: # pragma: no cover
print(
f"⚠️ Project {file.parent} is not pip installable. "
"Could not find setup.py or [build-system] in pyproject.toml.",
)
if installable:
_pip_install_local(
*installable,
editable=editable,
dry_run=dry_run,
flags=pip_flags,
)
if not skip_local:
# Install local dependencies (if any) included via `includes:`
local_dependencies = parse_project_dependencies(
*files,
check_pip_installable=True,
verbose=verbose,
)
names = {k.name: [dep.name for dep in v] for k, v in local_dependencies.items()}
print(f"πŸ“ Found local dependencies: {names}\n")
installed = {p.resolve() for p in installable}
deps = sorted(
{
dep
for deps in local_dependencies.values()
for dep in deps
if dep.resolve() not in installed
},
)
if deps:
_pip_install_local(
*deps,
editable=editable,
dry_run=dry_run,
flags=pip_flags,
)

Allow specifying `environment.yaml` in `local_dependencies`

Edit: while implementing this in #113 I realized this is a bad idea.
We cannot extract any dependencies that would also be installable with conda and therefore the whole situation becomes much more complicated.

Therefore the only option currently remains for unidep to be "infectious" for local dependencies.

unidep install with --conda-env-name refers to prefix environment instead named environment

unidep install requirements.yaml --conda-env-name 311

ValueError: Could not find conda prefix with name `311`. Available prefixes:
πŸ‘‰ C:\ProgramData\mambaforge_22.9.0.2
πŸ‘‰ C:\Users\login\.conda\envs\310
πŸ‘‰ C:\Users\login\.conda\envs\311
πŸ‘‰ C:\Users\login\.conda\envs\312
πŸ‘‰ C:\Users\login\.conda\envs\39

It seems the named-environments fall back to computing prefix-environments but don't find them (?), despite 311 existing.
I'm running unidep from a pipx install.

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.