question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

First impressions & suggestions

See original GitHub issue

There are some minor things that occurred to me when taking my first steps with nox-poetry:

  1. the distribution_format argument to installroot needs to be of type DistributionFormat; it would be handy if it would accept strings (‘sdist’, ‘wheel’) as well.

  2. installroot requires distribution_format to be passed as a keyword argument. I didn’t know this was possible and this is the first time I encountered this so it confused me.

  3. Perhaps a (slightly) nicer way to integrate with nox is to offer a replacement for nox.session. Then one could do:

     from nox_poetry import session, SDIST
     
     @session()
     def unit(session):
         session.installroot(SDIST)
         session.install('pytest')
         session.run('pytest', 'tests')
    

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
brechtmcommented, Feb 6, 2021

Perhaps Nox could accommodate by providing extensions points?

Yes, I actually experimented with making nox pluggable here, but it requires a lot more work and thought. I think I implemented a bunch of other hooks to see where this could go, but never pushed them. The downstream changes are in #119.

Maybe the Nox maintainers would be open to integrating nox-poetry into Nox, seeing as Poetry seems to be gaining significant traction?

Oh now I see what you meant, using inheritance to allow type checking without duplicating the interface.

Sorry, I was thinking out loud and not making much sense. The main idea was to subclass nox.Session and simply extend/override. I was assuming the session decorator would allow using the nox-poetry Session class, but alas the Nox architecture doesn’t allow for that.

I addressed some of your other suggestions regarding DistributionFormat in #261. Do you find the interface more usable with these changes?

❤️ Love it!

I’m still unsure about your suggestion regarding the use of keyword-only arguments, i.e. allowing installroot("sdist") instead of installroot(distribution_format="sdist"). The second form is admittedly quite wordy. On the other hand, I like how keyword-only arguments make it easier to extend an API, and how they make function calls more explicit. So I tend to use them when the parameter is, informally, about the “how” rather than the “what”.

That makes perfect sense. Encountering this for the first time just confused me. Perhaps add something to the README if more people complain about is? As for the wordy distribution_format, you could consider renaming it to format.

1reaction
cjolowiczcommented, Mar 1, 2021

Maybe the Nox maintainers would be open to integrating nox-poetry into Nox, seeing as Poetry seems to be gaining significant traction?

Personally, I’d prefer the Nox API to remain based on packaging standards, possibly with extension points for specific tool support. Also, I feel that nox-poetry needs to mature a little more before I would suggest changes to Nox. Poetry is also still evolving quite significantly, and I’m still hoping for a situation where Poetry’s feature set would render nox-poetry superfluous.

[re: keyword-only arguments] Perhaps add something to the README if more people complain about is?

Sounds good.

As for the wordy distribution_format, you could consider renaming it to format.

Yes, I’ve considered that. It’s a good name in the context of build_package, a little less so in the context of installroot. But acceptable, I guess. However, we’d need to deprecate the old keyword argument. There’s some prior art in the codebase for that.

PR(s) welcome 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Make a Good First Impression: 14 Tips to Try
Arrive early. Be empathetic. Actively listen. Be mindful of your body language and posture. Modulate your pitch and tone of voice. Choose your ......
Read more >
How to Make a Great First Impression
What the Experts Say · Prepare talking points · Be aware of your body language · Play to your strengths · Find something...
Read more >
6 tips for making a good first impression
6 tips for making a good first impression · 1. Know your audience · 2. Exude confidence · 3. Field questions gracefully ·...
Read more >
8 killer ways to make a good first impression - Ladders
1. Dress to impress · 2. Wipe that look off your face · 3. Appear Interested · 4. Politeness matters · 5. Offer...
Read more >
The Ultimate Guide To Making a First Impression (even online)
How long does it take to make a first impression? Research shows that most people make a first impression of a person within...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found