Poetry: Does poetry support a src/ layout?

Created on 19 Apr 2018  路  9Comments  路  Source: python-poetry/poetry

Hi,

I am considering poetry for a new project at work. Does it support having the project files in a src/ subdirectory? How do I tell it where to look for my project files?

Cheers!

Configuration Feature Packaging

Most helpful comment

Release 0.9.0 is out!

All 9 comments

Currently no, unfortunately. However, this is planned and might make it in the next feature release.

I'll keep you posted.

Thanks! Poetry looks very promising!

It is now implemented in the develop branch (0bff3b1) and will be available in the next 0.9.0 release.

Release 0.9.0 is out!

Nice, thanks!

Quick question - does it _just_ work? I was looking for info about this before I actually start converting my packages. At the moment I do something like this:

packages=find_packages(where='src'),
package_dir={'': 'src'},

Will Poetry just recognize that and do it for me? That would be cool : )
And if so, I think a mention in the README (docs?) would be helpful. I'd be happy to help.

You can check https://github.com/sdispater/poetry/issues/92#issuecomment-387092703 to see the src/ layout that is supported.

Please add documentations for this to the following:

https://python-poetry.org/docs/libraries/
~https://python-poetry.org/docs/pyproject/~

Ahh this has been added although the syntax is confusing and undocumented:

packages = [
    { include = "my_package", from = "lib" },
]

Is from = "lib"? the /path/to/src or is include = "my_package"

@ketozhang I just found the documentation: https://python-poetry.org/docs/cli/#new (see last two paragraphs).
I didn't have to change packages for my setup to work.

Was this page helpful?
0 / 5 - 0 ratings