Skip to content
Discussion options

You must be logged in to vote

Here is an example that hopefully demonstrates what you are attempting to do. I am using the latest preview release for this. But should work for latest stable as well.

Create new project

I am using the source layout here since its cleaner, and prevents package imports working by virtue of python adding CWD to your PYTHONPATH.

$ poetry new --src foobar
Created package foobar in foobar
$ tree foobar/
foobar/
├── pyproject.toml
├── README.md
├── src
│   └── foobar
│       └── __init__.py
└── tests
    └── __init__.py

3 directories, 4 files

Create example script

$ cd foobar/
$ mkdir -p contrib/examples
$ cat > contrib/examples/hello.py <<EOF
> if __name__ == '__main__':
    import foobar

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Tegomena
Comment options

Answer selected by abn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants