Skip to content
Snippets Groups Projects

Draft: Resolve "Lint sphinx copyright statement"

Open Wout De Nolf requested to merge 2-lint-sphinx-copyright-statement into main
2 unresolved threads

Closes #2

Lint ./doc/conf.py when present. Currently only checks the copyright statement.

Edited by Wout De Nolf

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
198 echo ' print(f"No package '{package_name}' on pypi")' >> assert_copyright.py
199 echo 'else:' >> assert_copyright.py
200 echo ' releases = res.json()["releases"]' >> assert_copyright.py
201 echo ' dates = {' >> assert_copyright.py
202 echo ' datetime.fromisoformat(frelease["upload_time"])' >> assert_copyright.py
203 echo ' for release in releases.values()' >> assert_copyright.py
204 echo ' for frelease in release' >> assert_copyright.py
205 echo ' }' >> assert_copyright.py
206 echo ' first_publish = min(dates).year' >> assert_copyright.py
207 echo ' last_publish = max(dates).year' >> assert_copyright.py
208 echo ' if first_publish == last_publish:' >> assert_copyright.py
209 echo ' expected = f"{first_publish}, ESRF"' >> assert_copyright.py
210 echo ' else:' >> assert_copyright.py
211 echo ' expected = f"{first_publish}-{last_publish}, ESRF"' >> assert_copyright.py
212 echo ' assert conf.copyright == expected' >> assert_copyright.py
213 - cat assert_copyright.py
    • IDK.

      We could instead dynamically set the copyright date to the year of the last commit when building the doc of the relevant project. So that this linting becomes unneeded.

    • Yes I was thinking about this. We would need to create an separate project (ewoksdocs or esrfdocs or whatever) and include the logic in there and have it a [doc] dependency.

      Btw, when looking for explanations on copyrighting, the years seem to refer to "publication" years. Git or PyPi publication :shrug:. Obviously I took pypi publication here.

      Edited by Wout De Nolf
    • Please register or sign in to reply
  • Wout De Nolf added 1 commit

    added 1 commit

    Compare with previous version

  • Wout De Nolf marked this merge request as draft

    marked this merge request as draft

  • Please register or sign in to reply
    Loading