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.

make `poetry version` work like `npm version`

See original GitHub issue

update

Please see @mattyclarkson 's comment below for what this issue should be!


  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

Interested to see what others feel about this. I’ve braino’ed poetry version a couple of times when I meant poetry --version. “version” is a noun in my head, and poetry inc_version would be more explicit.

However, I’m well aware this might just be me, so thought I’d ask/suggest here and see what others said 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

10reactions
mattyclarksoncommented, Nov 19, 2018

@cjw296 I sorta more meant that the command name mapped well, not the default operation. sorry to be unclear.

@abn they are different things?

command npm outcome poetry outcome
<tool> version --version outputs tool version outputs tool version
<tool> version outputs project version information bumps patch version
<tool> version patch bumps project patch version and creates a commit bumps project patch version number
<tool> version minor bumps project minor version and creates a commit bumps project patch minor number
<tool> version major bumps project major version and creates a commit bumps project major version number

The only difference is that poetry defaults to bumping the minor version rather than outputting the current project version and npm/yarn create commits. I think that is acceptable; if a little bit unexpected when moving from npm/yarn.

Having said that, considering that poetry seems to be poised to be the npm/yarn for the Python world, it would make sense to use the years of development that has been poured into those tools. If we can be compatible, when people switch between tools it is less jarring. Obviously, there are somethings that just aren’t going to be the same; they are different ecosystems. There will be similarities (version/ running scripts) though and it would make sense not to reinvent the wheel. npm/yarn do have some warts (see the prepublishOnly script situation) but generally work pretty well.

We have both JS devs and ML Python devs. Having the same workflow really helps. poetry almost does this.

3reactions
kbakkcommented, Mar 5, 2019

I think this issue deserves more thumb up’s, given the update in the issue.

Right now I have to work around this by installing a toml library to read the pyproject.toml, and running a one-liner to get the project version. For anyone curious:

python -c 'import tomlkit; print(tomlkit.parse(open("pyproject.toml").read())["tool"]["poetry"]["version"])'

Since what @mattyclarkson suggests is a breaking change, putting it in the 1.0 release seems fitting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduction | Documentation | Poetry - Python dependency ...
Introduction Poetry is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on...
Read more >
How to Set Up Python and Poetry
How to Set Up Python and Poetry · $ brew install pyenv · if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init...
Read more >
Feature comparison between npm, pip, pipenv and Poetry ...
To create and use a new venv switch Python versions using pyenv then create a new venv. >>> pyenv global <different Python version>...
Read more >
Semantic Release Python (with Poetry Support) - npm
A semantic-release plugin for PyPi.org that supports both regular and Poetry projects. Latest version: 2.5.30, last published: 8 months ago.
Read more >
5 Reasons Why Poetry Beats Pip Python Setup
Sounds familiar? looks like an npm package.json config file. ... Poetry will get the current active version of python to create and activate ......
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