-
Notifications
You must be signed in to change notification settings - Fork 2
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
Project structure and automation #23
Conversation
c4bd1b6
to
c1b2fac
Compare
a691a7e
to
834a604
Compare
ce05dee
to
11d373e
Compare
5e67d59
to
6012f09
Compare
With the beginning of more CI/CD, we should consistently use the .github directory for github-specifics.
The condition for debug only prints previously used the wrong variable, making the condition useless. Now the correct variable that is passed as an argument is used for evaluation of the condition.
PXIInstruments in PyVISA do not have the read() or write() methods. Pysweepme cannot yet handle this case and would fail. Therefore we raise an Exception telling the user that this is not implemented and has to be written in the DC itself.
Address issues revealed by MyPy by fixing types that could not be derived or were wrong. This commit does not yet address missing function argument / return type annotations.
Fix issues revealed by ruff for easy-to-fix rules to create a baseline that can be used from now on and should not fail. Checking for open TCP/IP ports using the psutil.net_connections() will not return IP addresses in case of Unix sockets. This case must to be caught, ruff violations are ignored here.
Add project files with information and metadata about pysweepme and its dependencies for building wheels, as well as configurations for ruff, black, and mypy.
Include a script that runs ruff with a lot of rules enabled. This currently creates a whole bunch of violations in pysweepme. The script will compare the output to a reference run, which uses the current code from master (and the rules from the current branch) and raises an error if for any file-rule combination the amount of violation increases. That way, we do not need to fix thousands of violations in one go, and at the same time we ensure that we do not incorporate more and more violations if we would not check those rules. Adding pytest for running unit tests and also include one test that checks if the pysweepme import does not initialize the FolderManager yet. This would lead to issues in the multi-instance feature of SweepMe! and might not be spottet right away. The tox.ini has the ruffregression in the first place, so that when running two processes in parallel, it starts rightaway (has the longest runtime).
Add a github workflow that will build and publish pysweepme. After creating the wheel, pysweepme can be published to PyPI or TestPyPI. Publishing to PyPI is only allowed from the main branch. In case of the main branch / upload to PyPI, a tag is added to the respective commit in the repository. We do not add tags for TestPyPI or development branches, because it is not strictly necessary and would just look bad in the repository after rebases. In particular if multiple rebases and publications are done alternating. Credentials for publishing to (Test)PyPI are securely stored as github Environment Secrets.
Add a script and a workflow that get the version of pysweepme in the branch and check if this version is already online on PyPI. If it is, the workflow will raise an error, reminding the developer to update the version number of pysweepme.
In "Run Checks" only the ruff-regression fails. This is expected, because this check compares existing linting violations to the main branch. However, as the checks are just introduced in this PR, the reference of the linting results from the main branch don't exist yet. This should work starting from the following PR, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
everything looks very good
(modern way of setup.py/cfg and more)
__init__.py
has been adjusted (and does not yet exist on pypi)