Comments (6)
This feature is not available in in 0.27.0 🚀
It is documented here.
from poethepoet.
Hi @jaklan, thanks for the feedback. I see how this would be useful.
I'm currently working on a bit of a refactor of config management works, which adds support for referencing env vars in the include path. So maybe exposing something like ${POE_GIT_ROOT}
would do the trick there?
Supporting sub-shell syntax would be a bit of a different story.
from poethepoet.
@nat-n thanjs for the quick response! Afaik git
doesn't expose any envar to identify the repo root, but if you provide it as a custom poe
var - I believe it should be good enough for many use-cases (incl. ours).
We would just like to avoid a situation when it's needed to rely on an envar which has to be set locally by all developers.
from poethepoet.
Hi @jaklan, I was thinking about exactly how to implement this, as a lazily resolve environment variable set by poe, and I realised the problem isn't as it seemed.
Firstly, how exactly should POE_GIT_ROOT
be defined by poe? If it's relative to the present working directory then that won't always be inside the project making it brittle. If it's relative to the relevant config file then it gets complicated if you're composing your project with git modules. And if it's relative to the root config file, then you probably already have the answer you care about with the POE_ROOT
environment variable without having to consult with git.
What do you think the logic should be to be robust?
EDIT: maybe the way to be consistent despite submodules is git rev-parse --show-superproject-working-tree --show-toplevel
?
from poethepoet.
I just thought about triggering $(git rev-parse --show-toplevel)
in current (or specified) working directory, as an alternative to specifying a shell command directly in include
. I won't really help with the submodule case, I don't use them intentionally.
About POE_ROOT
:
POE_ROOT: path to the parent directory of the main tasks file (e.g. pyproject.toml).
If we have the structure like:
pyproject.toml
projects/
-- pyproject.toml
-- foobar/
---- pyproject.toml
and define:
[tool.poe]
include = "$POE_ROOT/pyproject.toml"
in projects/foobar/pyproject.toml
- would it refer to the root directory, to projects/
, or to projects/foobar
? How to understand "the main tasks file" here?
from poethepoet.
@nat-n that's so cool, thank you!
from poethepoet.
Related Issues (20)
- Using argument values to interpolate into task env values in cmd/shell tasks? HOT 2
- Missing POSIX executable on Win10 HOT 2
- Postinstall hook with tasks refering to package that's being installed HOT 1
- $POE_ROOT/$POE_PWD unavailable in tool.poe.env section HOT 3
- Including tasks from another file does not work with the poetry plugin when the poetry command is "" HOT 5
- Q-data@love
- Provide default poe root through env var HOT 2
- Wrap poetry HOT 3
- Poe uses different CLI args for working directory than Poetry HOT 2
- "Task names must start with a letter or underscore" error in 0.26.0 HOT 4
- docs recommended method fails to install as plugin at MacOS with poetry 1.8.3 HOT 2
- Improve display for sequence tasks
- sequence tasks | capture_stdout not working HOT 1
- User-defined variable substitution in [tools.poe.env] does not work since 0.26.0 HOT 2
- Unable to define a command which spans multiple lines HOT 3
- Poe script task uses global python path instead of the one in the virtual environment HOT 1
- Global task configuration? HOT 2
- env file interacts badly with glob HOT 2
- How to share variables among tasks? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poethepoet.