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

v0.7.0 #327

Merged
merged 40 commits into from Sep 11, 2021
Merged

v0.7.0 #327

merged 40 commits into from Sep 11, 2021

Conversation

sergeyklay
Copy link
Collaborator

No description provided.

sergeyklay and others added 30 commits September 4, 2021 18:26
Add support for negative float strings
Fix links in the documentation
Use default option in Env.bytes()
Currently, if a `.env` file isn't found by the read_env() classmethod,
it raises a UserWarning. Based on Python's logging guide,
warnings.warn() is only appropriate to be raised in library code if the
issue is avoidable and the client application should be modified to
eliminate the warning.

Conversely, it recommends logging.warning() if there is nothing the
client application can do about the situation, but the event should
still be noted (see ref1).

In this particular case, the function is working with `.env` files that
should only ever exist in development environments, which means that
the function will erroneously warn the consumer in production and
staging environments.

With this in mind, I believe the most sensible thing to do would be to
convert read_env from using the warnings module to using the logging
module. Additionally, since the lack of a `.env` file is going to occur
regularly during normal operation of the program, I also believe that
this should be downgraded to an INFO level message from a WARNING
level message.

#243 requests that the .env file be made
optional, and as far as I can the .env file is indeed optional, it's
just that a UserWarning is being raised instead of a logged message.
With that in mind, I'm referencing it as being closed by this change.

ref1: https://docs.python.org/3/howto/logging.html#when-to-use-logging

fixes: #243
…tional

Stop raising UserWarning if .env file isn't found
@sergeyklay sergeyklay added the release Project release label Sep 11, 2021
@sergeyklay sergeyklay self-assigned this Sep 11, 2021
@coveralls
Copy link

coveralls commented Sep 11, 2021

Coverage Status

Coverage increased (+0.3%) to 89.933% when pulling d0a2b46 on develop into 4e327ec on main.

@sergeyklay sergeyklay merged commit caf1ce2 into main Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release Project release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants