New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] add self.*_path
properties that return pathlib.Path
#11304
Comments
The problem with this is that Conan 1.X still supports Python 2.7 (sigh, I know...), so this couldn't be added. We will probably start to use |
Makes sense. A possible way to support this AOT would be to add
try:
from pathlib import Path
except ImportError:
from pathlib2 import Path Then we could have the newer properties available before v2.0.0 to aid transition. It might be possible then to just nuke |
@memsharded Are there any chances that Conan 2.0 will have it? I find it extremely convenient to be able to write I think it is important to make this switch in Conan 2.0 so new recipes can rely on this functionality. |
Maybe now that Conan 1.X dropped Py2 support, it is an option. Someone wants to contribute a PR for Conan 1? (it needs to be there, in order to have compatible recipes in both 1.X and 2.0) |
here we go: #11585 |
We have
recipe_folder
,source_folder
, etc that returnOptional[str]
.It would be nice to work with filesystem paths using
pathlib.Path
.As the
*_folder
can beNone
in certain stages, it is usually a programming error accessing them when they areNone
.It would be nice to have the following accessors on the
ConanFile
:Then we can use it like so:
Which is much nicer that the equivalent code with
os.path
.The text was updated successfully, but these errors were encountered: