Skip to content

Add constraint and version utils#1375

Closed
dazza-codes wants to merge 1 commit into
python-poetry:developfrom
dazza-codes:add-semver-utils
Closed

Add constraint and version utils#1375
dazza-codes wants to merge 1 commit into
python-poetry:developfrom
dazza-codes:add-semver-utils

Conversation

@dazza-codes
Copy link
Copy Markdown
Contributor

@dazza-codes dazza-codes commented Sep 13, 2019

  • Added tests for changed code.
  • Updated documentation for changed code.
    • no docs required - internal utils only

Add constraint/version utils for boolean checks and sorting

  • TODO notes about PEP-0440 vs. SEM-VER tests for TDD
  • should be OPEN to adding PEP-0440 or SEM-VER config options down the road
  • punting on PEP-0440 vs. SEM-VER implementations

@dazza-codes dazza-codes force-pushed the add-semver-utils branch 3 times, most recently from fd68e4c to 6adcec1 Compare September 13, 2019 18:35
@dazza-codes dazza-codes changed the title [WIP] Add semver utils Add semver utils Sep 13, 2019
@funkyfuture
Copy link
Copy Markdown
Contributor

what problem is this solving and how does it relate to #1268?

@dazza-codes
Copy link
Copy Markdown
Contributor Author

dazza-codes commented Sep 15, 2019

  • @funkyfuture - good question and please LMK if you have similar work and or interests in this area - this is WIP to explore the existing poetry behavior and evaluate the specs/behavior for semver vs. PEP-0440 and it stands as an independent PR from Add semver utils, using semver library #1268 (because that PR stands alone with a focus on sem-ver utils and possibly future support for sem-ver config options, which all depend on having sem-ver utils in the first place). IF Add semver utils, using semver library #1268 is accepted, in some form, further work on this might proceed after a rebase on that stuff. Aside from Add semver utils, using semver library #1268, the initial intention of this work on this PR was to focus on PEP-0440 specs/behavior (and to distinguish between PEP-0440 and sem-ver specs/behavior). But, the PR morphed a bit and started to focus on some basic constraint/version utils and it might be in a form now that could be useful (so, in this form, it's not tagged WIP; the tests have some TODO items in there that might be taken up in follow-on PRs).
  • apologies, the PR was mis-named as adding sem-ver utils (it's not that), so the PR is renamed now
  • have not looked at any of the failing checks and will not do so until I pick this up at some later date, depending on time and further interest in it.

@dazza-codes dazza-codes changed the title Add semver utils Add constraint and version utils Sep 15, 2019
Comment thread poetry/semver/__init__.py Outdated
Comment thread poetry/semver/constraint_utils.py
Comment thread poetry/semver/constraint_utils.py Outdated
Comment thread poetry/semver/constraint_utils.py Outdated
Comment thread poetry/semver/constraint_utils.py Outdated
Comment thread poetry/semver/constraint_utils.py
@@ -0,0 +1,48 @@
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like duplicated code from semver/constraint_utils.py.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference is that this uses Version.parse whereas the constraint code uses parse_single_constraint and, AFAIK, the constraints are not versions (although versions can be constraints, the distinction stands).

("*", True),
("*.*", True),
("v*.*", True),
("*.x.*", True),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't know these and they look strange to me.

Copy link
Copy Markdown
Contributor Author

@dazza-codes dazza-codes Oct 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are present elsewhere in poetry tests, this is a copy-n-paste and I don't know where they come from either. The point of this is just to use what poetry already has in it's tests on the methods wrapped by the boolean utils.

("1.2.3b5", True),
(">= 1.2.3", True),
(">dev", True),
("n.a.n", False),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above, these are already in poetry tests; only added an n.a.n to be sure that it doesn't match a constraint because it's all chars but otherwise matches the pattern.

@dazza-codes
Copy link
Copy Markdown
Contributor Author

@funkyfuture - thanks for code review, tried to address most of the requests, just a couple questions or tweaks remain; will follow-up if time permits.

- boolean checks for a constraint/version string
- filter & sort a sequence of constraint/version strings
- use existing poetry methods for constraints & versions
@stale
Copy link
Copy Markdown

stale Bot commented Dec 4, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Dec 4, 2019
@dazza-codes
Copy link
Copy Markdown
Contributor Author

Thanks for marking my contributions as stale. Despite my best efforts to contribute, the poetry review and merge cycles are too slow. This is discouraging for updating and further contributions.

@stale stale Bot removed the stale label Dec 5, 2019
@dimbleby
Copy link
Copy Markdown
Contributor

dimbleby commented Jul 1, 2022

I make no comment on whether this MR was stale or useful when the stalebot involved itself - but it certainly is stale now.

I expect that contributor has no interest in reviving this and it can now safely be closed.

@Secrus
Copy link
Copy Markdown
Member

Secrus commented Aug 16, 2022

Closing as stale (and probably merging hell at this point).

@Secrus Secrus closed this Aug 16, 2022
@dazza-codes
Copy link
Copy Markdown
Contributor Author

Yea, I've totally lost interest in contributing to poetry.

@github-actions
Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants