Skip to content

sessions: require a session? #453

@henryiii

Description

@henryiii

How would this feature be useful?

Often, especially with building things like binary extensions (which is where I do a lot of work), it is useful to build once and then use the built products (wheels usually, could also be docs) in other sessions. From looking around, it seems like tools like pip currently are just manually running a function that sets up the required produces, and putting that in front of everything that needs it - which is really slow if this is trying to build something.

In the noxfile I'm working on for CMake currently, I'd like to produce the wheel (several minutes) then run an array of tests (all versions of Python) on it, since it doesn't get tied to the current version of Python. But I've also needed this for a "serve" job for docs depending on a "build" job, for different jobs in packages that depend on building a wheel (even if it's only for the current python version), etc.

Describe the solution you'd like

I feel like this is exactly the opposite of notify (or whatever it gets renamed to if #398 changes anything rather than just updating the docs). It could be requires=[...], which would list session that have to run to completion before this session starts. So requires=[build] would not start this session until the build session completes, and would add "build" to the queue if it is not explicitly requested.

A caching system would be amazing, but is orthogonal and not needed to get a benefit for this.

Describe alternatives you've considered

Maybe there's a way to do this that I'm just missing? Happy if there is already a way to do this that I've missed. It can be partially be done by hand, by writing a function that builds an output the first time it's called, and then just does nothing on each subsequent call.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions