-
Notifications
You must be signed in to change notification settings - Fork 79
added the newline parameter to PatchSet::from_filename and a test cas… #83
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
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3fb563d
added the newline parameter to PatchSet::from_filename and a test cas…
huichen-cs abdeb52
Create main.yml
huichen-cs 349a61f
Update main.yml
huichen-cs 05ea04b
Update main.yml
huichen-cs 9411f2f
Update main.yml
huichen-cs 014a03e
Update main.yml
huichen-cs 6926d01
Update main.yml
huichen-cs 7d57e85
Update patch.py
huichen-cs 2631cb0
Update test_parser.py
huichen-cs 40adadc
removed a useless runner command from the Github Actions
huichen-cs 57f14e1
specify python version 2.7 and 3.6-3.9 and cleaned configuration file…
huichen-cs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| pull_request: | ||
| branches: [ master ] | ||
|
|
||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: self-hosted | ||
| strategy: | ||
| matrix: | ||
| python-version: [ '2.7', '3.6', '3.7', '3.8', '3.9' ] | ||
| fail-fast: false | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| architecture: 'x64' | ||
| - name: 'Run Tests' | ||
| run: $GITHUB_WORKSPACE/run_tests.sh | ||
| shell: bash | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I was considering moving CI to actions, but maybe we can propose this change in a different PR?
Uh oh!
There was an error while loading. Please reload this page.
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.
Hi, @matiasb ,
Thanks.
My original intention was to use this to run tests for Python 2.7.
As related, my initial pull request failed the test for Python 2.7 because
codecs.opendoes not have thenewlineparameter. In a commit that follows, I revise it to useio.openfor Python 2.7, and all tests passed.If you think these changes are OK, I will resubmit the proposals, perhaps, in two pull requests, one is to add the
newlineparameter, and the other to add the configuration file for Github actions.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.
A comment motivated by the issues related to Python 2.7. The package
unidiffsupports Python 2.7:python-unidiff/setup.py
Lines 48 to 49 in 3353080
The final release of Python 2.7 was about 2 years ago (PEP 373). The final release of Python 3.6 is expected to be in about 2 months (PEP 494). So it seems that moving to code compatible with only Python 3 would not cause issues.
Supporting only Python 3 will enable using new syntax, for example formatted string literals, parenthesization within
withstatements, and structural pattern matching (when the supported Python versions will all be >= 3.10).For the full new syntax of formatted string literals, Python >= 3.8 is required. Nonetheless, this would still mean that three Python versions are supported (3.8, 3.9, 3.10), which aligns with the extent of support for past Python versions in packages like
numpy,scipy, andnetworkx.(Sidenote: Python 3.9 is in the CI test environments:
python-unidiff/.travis.yml
Line 7 in 3353080
but not in the Trove classifiers:
python-unidiff/setup.py
Lines 45 to 54 in 3353080
)
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.
Yeah, we should be ok dropping the Python 2 support. Will do the paperwork (so feel free to not keep things py2 compatible). And right, it seems we need to update the metadata. Thanks 👍