-
-
Notifications
You must be signed in to change notification settings - Fork 46.3k
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
Config Travis CI for two jobs #2463
Conversation
Ignore the NOTE. I have removed the branches section. One more thing about the |
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.
Awesome!
That is a completely separate topic so please make that a separate PR.
|
Can you please open an issue on https://github.com/python/mypy to verify the requirement for |
Sorry for not putting Python in capitalize. I will keep that in mind. Thanks for pointing it out. There's already an open issue about it: python/mypy#6385 It seems not to be fixed and the only option right now is to add |
I put mypy into || true mode because of python/mypy#7907 so let's hold off on adding all the |
Ok. Sorry for the multiple deletions, I wanted to clean the history properly on my local copy. |
Do you want me to fix the |
Let's hold off on mypy-related changes for now (unless you just want to fix the Project Euler ones). Instead, let's focus on pytesting the return values of the Euler algorithms. |
Alright. So a few ideas right out of head are:
|
Let's try to build #1 (single file) but cover just subdirectories problem_01 thru problem_09 with a single test file. We can see how difficult it is and optimize the code. If we create a test file per directory, it will be a ton of work to keep them in sync. |
Alright, I took a look at the files and found some inconsistencies:
What do you think about the above-mentioned points? If we implement them, testing will be easier from one file otherwise we will have to manually look at each file to see how it returns the answer and check accordingly. |
Please open a new issue for this effort. Let’s not change the directory names... for i in range(101):
print(f"problem_{i:02}") We should use Pathlib to find all Python files in each directory... As long as they end in .py and do not contain test_ then we should assume they are valid. Let’s start by trying to import solution() from each file and call it with no parameters to see how far we get. We should use logging and write all errors to a log so we have a hitlist of files to investigate.
|
Alright, I'll get on it. |
* Testing Travis CI configuration for project Euler * Fix: Installing mypy and pytest-cov for testing * Remove unnecessary checks for project_euler job * Removing branches section * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml Co-authored-by: Christian Clauss <cclauss@me.com>
As discussed in #2439
Dividing Travis CI test into two jobs:
project_euler
directorypytest
onproject_euler
directoryNOTE: Before merging please tell me so that I can remove the
branches
section from.travis.yml
file as that was done only for testing for which the results are here: https://travis-ci.org/github/dhruvmanila/Python/builds/729560689Extra:
There's another error which I also wrote about in #2439 comment and I will paste it here:
The way
mypy
finds the python files are a bit tricky. In the Travis test,mypy
isn't going inside the project_euler directory because there's no__init__.py
file in it. We need to have the__init__.py
file in every directory and subdirectory to tellmypy
to look for python files in this directory as well which meansmypy
is skipping tons of files. It's checking only for 116 files while there are around 668 files with extension py with around 123 directories according to:I have written a bash script which will add all the init files in the directories where it's missing.
Do you want me to make another PR for it or just add it in here?
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.