Skip to content

add URL validator implementation & tests#256

Open
bieli wants to merge 1 commit into
23andMe:masterfrom
bieli:add-url-validator
Open

add URL validator implementation & tests#256
bieli wants to merge 1 commit into
23andMe:masterfrom
bieli:add-url-validator

Conversation

@bieli

@bieli bieli commented Nov 15, 2024

Copy link
Copy Markdown

Feature request #213 implementation.

Comment thread requirements.txt
@@ -1 +1,2 @@
tox==4.13.0
validators==0.34.0

@mildebrandt mildebrandt Nov 15, 2024

Copy link
Copy Markdown

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
Copy Markdown
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.

Copy link
Copy Markdown

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