-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add comments to test/ci files #50
Conversation
add comments to ci/test files
fix master branch name
Thank you! I’m not very familiar with the tools you are using, so it might take me a bit of time to figure out how to use them. At the moment, I’m having trouble understanding the output of pytest when I try running it on my local copy of the repository: c:\Users\polyanskiy\Documents\GitHub\refractiveindex.info-database>pytest ======================================================= ERRORS ======================================================== |
Ah interesting, this seems to be a windows vs. linux issue. Linux will use |
Actually I just made a PR for this: #52 |
Great! It's running now but it fails yaml files with certain Unicode characters (e.g., č): C:\Program Files\Python312\Lib\encodings\cp1252.py:23: UnicodeDecodeError |
Hmm, could you check which version of python you are using? I am using python 3.10.12 with yaml version 6.0.1. Is there any chance you are using a much older version? |
Actually, maybe this could fix it. Swap out line 39/40 with the following: with open(path, "r", encoding="utf8") as stream:
yaml.safe_load(stream) |
That’s it! Adding encoding="utf8" fixed the problem. |
Great! By the way, there seems to be an issue with dependabot, which I cannot debug because I don't have the appropriate permission. Could you access the "more information" link on this page and paste it here? Then I might be able to tell what is wrong. Thanks! |
Dependabot couldn't find any dependency files in the directory |
Ok, this can probably be fixed by updating the
|
Hi @polyanskiy --- as discussed in this thread, I'm adding some comments to test and CI files. Here's a quick summary:
tests/test_parse.py
: this test discovers all.yml
files in the database and checks that they can be successfully parsed. It can be invoked using thepytest
command, which automatically discovers and runs tests. (Thepytest
andparameterized
python packages must be installed)..github/workflows/test.yml
: this file defines a github action which checks out the repository, installspytest
andparameterized
, and then runspytest
. The action is configured to run on pull requests and for pushes to the master branch.I've also added a
.github/dependabot.yml
file, which will handle automatic security/version updates. For example, when a new version of the github checkout action is available, dependabot will create a PR proposing an update to thetest.yml
file.Finally, in creating this PR I noticed that another
.yml
file error appeared. Going forward, to make the most of the automated test/ci capabilities, I would suggest authoring PRs rather than directly pushing to the master branch. Then, you will have a chance to catch any issues before you merge.Let me know if you have any questions or if I can help otherwise.