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

378 Convert source tree to python-copier-template #667

Merged
merged 16 commits into from
Jul 23, 2024

Conversation

rtuck99
Copy link
Contributor

@rtuck99 rtuck99 commented Jul 10, 2024

This moves the project to the python-copier-template project style

Fixes #378

Notes

Documentation

  • Documentation from the template has been changed from .rst Restructured Text to .md Markdown style, and the folder hierarchy has been flattened to remove the separation between user and developer sections. This is probably a good move for dodal as the distinction between users and developers is somewhat blurred anyway. I have attempted to retain customisation of the documentation where appropriate.
  • The API documentation should still work

Development environment

  • Building standalone containers is no longer supported and relevant documentation removed, but there is now support for devcontainers (but I haven't tried it yet)

CI

  • Github workflows are now refactored out into reusable workflows prefixed by an underscore _ called from the main workflows.
  • Warnings in Pytest are now errors and this has resulted in a number of fixes to both production and test code:
    • Where async tasks were not awaited and outlived the lifespan of the test
    • Where file resources were not closed after being opened (notably in various logging tests)
    • Where deprecated methods were being called
    • Some warnings generated by code in our dependencies have been suppressed in pyproject.toml
  • There have been some changes to linter flags in pyproject.toml which add various additional checks

Dependencies

  • Nb python-copier-template has a dependency on pydantic >= 2.0 which conflicts with the rest of dodal dependencies so cannot be included in the list of development dependencies; you have to uninstall it after running it

Developer Portal

TODO

  • Pypi uploads on release (The option appeared partway through the upgrade and I left at the default)

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

@rtuck99 rtuck99 marked this pull request as ready for review July 11, 2024 09:53
@rtuck99 rtuck99 force-pushed the 378_move_to_copier_template branch from a13bbe1 to dfe4e6a Compare July 11, 2024 10:14
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

Attention: Patch coverage is 96.99248% with 4 lines in your changes missing coverage. Please review.

Project coverage is 94.17%. Comparing base (5ff36da) to head (473765a).
Report is 27 commits behind head on main.

Files Patch % Lines
src/dodal/devices/areadetector/adaravis.py 75.00% 1 Missing ⚠️
src/dodal/devices/areadetector/adsim.py 0.00% 1 Missing ⚠️
src/dodal/devices/oav/oav_parameters.py 75.00% 1 Missing ⚠️
src/dodal/utils.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #667      +/-   ##
==========================================
+ Coverage   93.55%   94.17%   +0.61%     
==========================================
  Files         105      108       +3     
  Lines        4114     4306     +192     
==========================================
+ Hits         3849     4055     +206     
+ Misses        265      251      -14     

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

Copy link
Collaborator

@dperl-dls dperl-dls left a comment

Choose a reason for hiding this comment

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

This all looks fine, probably too complicated to inspect every individual line - since warnings are now errors I can only assume things are on average better than they were

from dodal import __version__


@pytest.mark.skip_in_pycharm(reason="subprocess returns tty escape sequences")
Copy link
Collaborator

Choose a reason for hiding this comment

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

:(

@rtuck99 rtuck99 force-pushed the 378_move_to_copier_template branch from 7cb0857 to 8066200 Compare July 23, 2024 08:34
@rtuck99 rtuck99 merged commit 025efb0 into main Jul 23, 2024
18 checks passed
@rtuck99 rtuck99 deleted the 378_move_to_copier_template branch July 23, 2024 09:03
stan-dot pushed a commit that referenced this pull request Jul 24, 2024
* (#378) Initial changes for copier template v1.0.0

* (#378) More sensible pre-commit defaults. Fix some broken unit tests

* (#378) unit tests mostly working

* Add Pycharm project files to .gitignore

* (#378) Update to version v2.1.0 of copier template from v1.0.0

* (#378) minor fixes to documentation generation

* (#378) Enable pypi publishing

* (#378) Update software catalog info

* (#378) Rebase onto latest main

* (#378) Use diff-quality rather than pyright, make pyright, ruff happy

* (#378) Make ruff happy, and code less evil. Add diff-cover to dependencies

* (#378) Fix test failures due to missing decorator parentheses. Add missing pyright plugin to dependencies

* (#378) Set fetch-depth to 0 for diff-quality

* (#378) Fix dist CI

* (#378) fix tests, ruff after rebase against main

* (#378) Add warning suppression to unit tests for pydantic v2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move to copier
2 participants