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

Deprecate PPP_CONFIG_DIR for specifying config path #170

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Nov 21, 2024

This is a continuation of #169 to more fully deprecate PPP_CONFIG_DIR.

This may need updating to have it raise an exception completely. Further discussion is needed. Due to the previous deprecation warning, this PR should not be released until 1.9 is ready.

CC @pnuu @mraspaud @adybbroe

  • Closes #xxxx
  • Tests added
  • Tests passed
  • Passes flake8 pyorbital
  • Fully documented

@djhoese
Copy link
Member Author

djhoese commented Nov 21, 2024

Oh I also made pytest more strict and removed usage of datetime utcnow.

Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.97%. Comparing base (e27a1d4) to head (9a1aebe).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #170      +/-   ##
==========================================
+ Coverage   87.94%   87.97%   +0.03%     
==========================================
  Files          16       16              
  Lines        2306     2312       +6     
==========================================
+ Hits         2028     2034       +6     
  Misses        278      278              
Flag Coverage Δ
unittests 87.97% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@pnuu
Copy link
Member

pnuu commented Nov 21, 2024

I don't see utcnow in the diff, forgot to commit/push that bit?

@coveralls
Copy link

coveralls commented Nov 21, 2024

Coverage Status

coverage: 87.935% (+0.03%) from 87.904%
when pulling 9a1aebe on djhoese:dep-env-var
into 9700076 on pytroll:main.

Copy link
Contributor

@adybbroe adybbroe left a comment

Choose a reason for hiding this comment

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

Looks good, thanks.

@adybbroe
Copy link
Contributor

I don't see utcnow in the diff, forgot to commit/push that bit?

What do you mean? I am not following, sorry

@pnuu
Copy link
Member

pnuu commented Nov 22, 2024

I don't see utcnow in the diff, forgot to commit/push that bit?

What do you mean? I am not following, sorry

Above @djhoese said

Oh I also made pytest more strict and removed usage of datetime utcnow.

I don't see anything related to utcnow in the PR diff, so I was wondering whether something is still missing.

@djhoese
Copy link
Member Author

djhoese commented Nov 22, 2024

Ah yep. I'm just waking up and won't be in front of the computer for a while (kid's doctor appointment). I'll see if I can push it while getting kids ready for the day.

@@ -617,6 +611,9 @@ def table_exists(db, name):
return db.execute(query, (name,)).fetchone() is not None # nosec


def _utcnow():
return dt.datetime.now(tz=dt.timezone.utc).replace(tzinfo=None)
Copy link
Member

Choose a reason for hiding this comment

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

why do we want to remove the timezone info again?

Copy link
Member Author

Choose a reason for hiding this comment

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

To make them naive. Keeping the timezone would require a lot more work I assume. For example, sanitizing user inputs.

Copy link
Member

Choose a reason for hiding this comment

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

ok

Copy link
Member

Choose a reason for hiding this comment

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

If the datetimes are timezone-unaware, they can't be compared with tz-aware datetimes. I thought our goal was to make everything tz-aware across the Pytroll ecosystem.

Copy link
Member

@pnuu pnuu Nov 22, 2024

Choose a reason for hiding this comment

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

And I think making all of the datetimes tzinfo=None is even more work than make them use UTC. The None case would mean addinitional TZ conversion for pretty much everywhere where we declare the times as UTC.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't disagree that we should/could move toward UTC-aware times everywhere, but that wasn't my goal with my changes in this PR. I was mostly concerned about the warnings generated while running tests. I understand about 2% of pyorbital and the TLE portions, on a code level, are not part of that understanding. I should not be the person who does that conversion/translation in pyorbital. Maybe I'm overestimating how much datetimes are involved. If so I can take a stab at it, but I'm still not sure this is the PR for it.

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

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

LGTM! I suppose v1.9 is the next release then, right?

@mraspaud
Copy link
Member

oh, looks like tests are failing...

@djhoese
Copy link
Member Author

djhoese commented Nov 22, 2024

Since this requires a 1.9 release I'll let others (@adybbroe ?) answer whether or not this should be merged and released in 1.9 next or if there should be a 1.8.x release first.

@@ -617,6 +621,9 @@ def table_exists(db, name):
return db.execute(query, (name,)).fetchone() is not None # nosec


def _utcnow():
return dt.datetime.now(tz=dt.timezone.utc).replace(tzinfo=None)
Copy link
Member

@pnuu pnuu Nov 22, 2024

Choose a reason for hiding this comment

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

I'll just add the official "request changes" for this bit with regards to tz aware/unaware I commented earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready for review
Development

Successfully merging this pull request may close these issues.

5 participants