Skip to content

Conversation

@webbnh
Copy link
Member

@webbnh webbnh commented Aug 29, 2023

This PR is an attempt to reconcile the existing problems with packaging, installation, and PYTHONPATH.

This PR takes the existing relay subdirectory, which contains the __init__.py file and therefore defines the relay Python package, and moves it into a src subdirectory. (It also moves the existing tests directory which was a subdirectory of relay and makes it a peer of the new src directory at the top level; and, it moves the existing relay/requirements.txt file up a level to the src subdirectory.) With the commensurate changes to the setup.cfg file, the packaging now includes the file-relay sources as well as the relay stub-executable, so that, when the package is installed, the relay package is copied into the site-packages directory as it should be and it is available without explicitly defining PYTHONPATH. I'm not exactly sure what magic I've wrought here, but everything now seems to work as expected.

This PR also updates the ci.yml workflow to reflect the new directory structure (e.g., the locations of the respective requirements.txt files have changed, and the tests and sources are no longer in the same directory tree, so we have to request coverage for them separately) and to Pip-install the relay package from its sources (and to do it all in a single command). This allows the unit tests to work without a PYTHONPATH definition, testing the package as any other client would.

@webbnh webbnh added bug Something isn't working infrastructure CI, build, test harness, configuration, etc. labels Aug 29, 2023
@webbnh webbnh requested a review from dbutenhof August 29, 2023 22:03
@webbnh webbnh self-assigned this Aug 29, 2023
@webbnh webbnh mentioned this pull request Aug 29, 2023
Copy link
Member

@dbutenhof dbutenhof left a comment

Choose a reason for hiding this comment

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

Once you fix the "flake8y" code, I'll be interested in seeing whether the tests run. 😁

@webbnh webbnh marked this pull request as draft August 30, 2023 14:56
@codecov
Copy link

codecov bot commented Aug 30, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (74ae60d) 98.52% compared to head (91a05ab) 98.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #8      +/-   ##
==========================================
- Coverage   98.52%   98.52%   -0.01%     
==========================================
  Files           2        2              
  Lines         543      541       -2     
==========================================
- Hits          535      533       -2     
  Misses          8        8              
Files Changed Coverage Δ
src/relay/relay.py 100.00% <ø> (ø)
tests/test_relay.py 97.95% <100.00%> (ø)

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

@webbnh webbnh marked this pull request as ready for review August 30, 2023 16:34
@webbnh
Copy link
Member Author

webbnh commented Aug 30, 2023

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Such is the power of statistics: by removing three previously covered lines, I increased the fraction of non-covered lines, which therefore decreased the overall "coverage". 😆

In any case, this change is now ready for review.

This was referenced Aug 30, 2023
@webbnh webbnh merged commit 60f1ec5 into distributed-system-analysis:main Aug 30, 2023
@webbnh webbnh deleted the repackage branch August 30, 2023 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working infrastructure CI, build, test harness, configuration, etc.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants