HEPData / hepdata_lib

Library for getting your data into HEPData
https://hepdata-lib.readthedocs.io
MIT License
15 stars 37 forks source link

Update docs for "add_additional_resource" and other fixes #233

Closed GraemeWatt closed 9 months ago

GraemeWatt commented 9 months ago

I finally got around to addressing #197 that I opened in June 2022. In doing so, I encountered many basic problems with my local installation (on macOS 13.5.2 with Python 3.11) including running the tests and building the docs. I've tried to fix all the problems that I encountered. Consequently, the scope of this PR is much larger than originally intended. I'll try to summarise the problems and my fixes below.


:books: Documentation preview :books:: https://hepdata-lib--233.org.readthedocs.build/en/233/

codecov-commenter commented 9 months ago

Codecov Report

Merging #233 (0d77f11) into main (9330eb9) will increase coverage by 0.02%. The diff coverage is 100.00%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##             main     #233      +/-   ##
==========================================
+ Coverage   88.52%   88.54%   +0.02%     
==========================================
  Files           4        4              
  Lines         976      978       +2     
  Branches      202      203       +1     
==========================================
+ Hits          864      866       +2     
  Misses         82       82              
  Partials       30       30              
Flag Coverage Δ
unittests-3.10 88.54% <100.00%> (+0.02%) :arrow_up:
unittests-3.6 88.21% <100.00%> (+0.02%) :arrow_up:
unittests-3.7 88.21% <100.00%> (+0.02%) :arrow_up:
unittests-3.8 88.34% <100.00%> (+0.02%) :arrow_up:
unittests-3.9 88.34% <100.00%> (+0.02%) :arrow_up:

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

Files Coverage Δ
hepdata_lib/__init__.py 90.57% <100.00%> (+0.05%) :arrow_up:
hepdata_lib/helpers.py 77.69% <ø> (ø)
matthewfeickert commented 9 months ago

@GraemeWatt I'm about to go on holiday for a week and I won't have internet access, so while I might be able to do a first pass on this before I go to bed tonight I think I'll defer everything to your judgement and @clelange review. Thanks for this PR!

GraemeWatt commented 9 months ago

@GraemeWatt I'm about to go on holiday for a week and I won't have internet access, so while I might be able to do a first pass on this before I go to bed tonight I think I'll defer everything to your judgement and @clelange review. Thanks for this PR!

Sorry, I meant to comment that your review would be optional and only if you had spare time. I just thought I'd add you as a Reviewer since you contributed to improving this repository earlier in the year.

GraemeWatt commented 9 months ago

Hi @GraemeWatt - thanks, this changes quite a lot, but I agree with @matthewfeickert that things overall look good. I left a couple of suggestions/comments in the code.

Two general questions:

  • Why did you change the formatting in so many places, in particular those lines/separators?
  • Do we really need to disable pylint for missing imports in so many places (# pylint: disable-msg=E0401) or is this a setup issue on your side?

Thanks for the useful review! I've commented separately on your individual points. The formatting changes were necessary to avoid errors/warnings about incorrectly formatted .rst files when running Sphinx. I've now removed the # pylint: disable-msg comments that I added previously and fixed the Pylint errors by making some other changes (adding __init__.py, importing test_utilities.py as a relative module after hepdata_lib, adding math and array modules to extension-pkg-whitelist in pylintrc). My setup is not unusual (macOS 13.5.2 with Python 3.10), so I don't know why these errors didn't show up previously in the CI.

I also renamed the master branch to main as for other HEPData repositories (hope you don't mind). I updated the actions in the GitHub Actions workflows to hopefully close some of the open Dependabot PRs.

Is the release.yml workflow currently being used? If not, removing it from the repository would reduce maintenance. It seems to use many unofficial actions. I didn't update the python setup.py test line. If there's a reason why actions should not be upgraded, the dependabot.yml file should have an ignore option.

clelange commented 9 months ago

Is the release.yml workflow currently being used? If not, removing it from the repository would reduce maintenance. It seems to use many unofficial actions. I didn't update the python setup.py test line. If there's a reason why actions should not be upgraded, the dependabot.yml file should have an ignore option.

Yes, we should remove this action, there are better ones available now. I'll create an issue.

clelange commented 9 months ago

Actually, we have this in https://github.com/HEPData/hepdata_lib/issues/165 already, I renamed it slightly.

clelange commented 9 months ago

Thanks for addressing my comments, I'll merge this now.