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

Stop using pkg_resources #50

Merged
merged 4 commits into from
Jul 17, 2023
Merged

Stop using pkg_resources #50

merged 4 commits into from
Jul 17, 2023

Conversation

zmoon
Copy link
Contributor

@zmoon zmoon commented Jul 15, 2023

Resolves #49

@coveralls
Copy link

Pull Request Test Coverage Report for Build 5559304726

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 74.144%

Totals Coverage Status
Change from base Build 5556465637: 0.05%
Covered Lines: 390
Relevant Lines: 526

💛 - Coveralls

@@ -61,7 +60,7 @@
# built documents.
#
# get version using setuptools-scm
release = get_distribution("pydecorate").version
release = get_version("pydecorate")
Copy link
Member

Choose a reason for hiding this comment

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

I'm tempted to say maybe this should just be import pydecorate; pydecorate.__version__, but eh let's see how using this goes. I've never used it here.

font_path = resource_filename("pydecorate.fonts", "DejaVuSerif.ttf")
return aggdraw.Font("black", font_path, size=16)
font_path = HERE / "fonts" / "DejaVuSerif.ttf"
return aggdraw.Font("black", font_path.as_posix(), size=16)
Copy link
Member

Choose a reason for hiding this comment

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

Aggdraw needs a posix-y path for this? I've never used aggdraw on Windows so I wasn't sure.

Copy link
Contributor Author

@zmoon zmoon Jul 17, 2023

Choose a reason for hiding this comment

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

It just needed a string. I imagine it should work with str(font_path) as well1, I just prefer to see the / separators so usually use .as_posix() since most Windows things accept it (seems to work fine in the CI here).

Footnotes

  1. For future reference, I tried it out on Windows and it worked fine.

Copy link
Member

Choose a reason for hiding this comment

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

Ok. I don't feel strongly enough to change it. It does, at a glance, make a reader of the code think that Windows paths are supported. Let's merge this! Thanks.

@djhoese djhoese merged commit be94dbf into pytroll:main Jul 17, 2023
12 checks passed
@djhoese djhoese self-assigned this Jul 17, 2023
@zmoon zmoon deleted the font branch July 17, 2023 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pkg_resources is deprecated as an API
3 participants