Skip to content

libranet/demo-uv-workspace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uv workspace demo

This project demonstrates a uv workspace containing both regular Python packages and namespace packages.

See also

Project Structure

This workspace contains three packages:

  • foobar - A regular Python package located in src/foobar/
  • foo.sub1 - A namespace package located in src/foo-sub1/
  • foo.sub2 - A namespace package located in src/foo-sub2/

Installation

Install all packages in the workspace using:

uv sync

This will create a virtual environment and install all packages defined in the workspace.

Build all packages

uv build --all-packages

Interactive Python-shell

Open a shell with uv run python:

>>> import foo
foo.__path__
_NamespacePath([
    '<project-dir>/src/foo-sub1/src/foo',
    '<project-dir>/src/foo-sub2/src/foo'])

>>> import foo.sub1
>>> foo.sub1.hello()
Hello from foo.sub1!

>>> import foo.sub2
>>> foo.sub2.hello()
Hello from foo.sub2!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published