Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add URL validator implementation & tests #256

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bieli
Copy link

@bieli bieli commented Nov 15, 2024

Feature request #213 implementation.

@@ -1 +1,2 @@
tox==4.13.0
validators==0.34.0
Copy link

@mildebrandt mildebrandt Nov 15, 2024

Choose a reason for hiding this comment

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

Hi! I have a few concerns about using the validators package:

  1. It's still pre 1.0, so things can break between minor versions. Why isn't http://localhost:PORT a valid URL? python-validators/validators#285 (comment)
  2. It doesn't support http://localhost by default. url validator rejects some local URLs as invalid even though they should be valid python-validators/validators#392
  3. It doesn't support query strings without values. [Question]: Are URL query strings containing keys without values invalid on purpose? python-validators/validators#363
  4. The supported schemes are hard coded. https://github.com/python-validators/validators/blob/c9585e91f8b409029b059df148da4dc52bd951e3/src/validators/url.py#L42

And that's what I found in just 10 minutes. I'm sure this could work for a subset of users....but it's not a generic solution for all valid URLs.

Copy link
Author

Choose a reason for hiding this comment

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

Sure. Thanks for this feedback. I'll find something more universal.

Choose a reason for hiding this comment

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

Cool. FYI, currently Yamale has only one dependency....pyyaml. Anything you add will double the number of dependencies. I don't know how the current maintainers feel about that, but just something to keep in mind.

A couple other things:

  1. Don't update the version of Yamale in your PR. That's done during the release process.
  2. Add any new dependencies in the setup.py file.

Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants