Skip to content
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

Issue #1891 #1899

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

AlexandrKhabarov
Copy link
Contributor

I have made things!

  • Add windows-specific build
  • Skip platform-specific tests

Checklist

  • I have double checked that there are no unrelated changes in this pull request (old patches, accidental config files, etc)
  • I have created at least one test case for the changes I have made
  • I have updated the documentation for the changes I have made
  • I have added my changes to the CHANGELOG.md

@AlexandrKhabarov
Copy link
Contributor Author

@sobolevn
Hello, Nikita!
I'm not really sure that I properly understand how github actions actully works.
Can you review my request and give some feedback?

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks a lot! Please, take a look at my questions 👍

setup.cfg Outdated
@@ -127,6 +127,9 @@ rules =
"sys_version_info < (3, 9)": py-lt-39
"sys_version_info >= (3, 9)": py-gte-39

"exec('import os') or not os.name == 'nt'": not-win
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

runs-on: windows-latest
strategy:
matrix:
python-version: [ 3.6, 3.7, 3.8, 3.9 ]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
python-version: [ 3.6, 3.7, 3.8, 3.9 ]
python-version: [3.6, 3.7, 3.8, 3.9]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

with:
file: ./coverage.xml


Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -24,6 +24,9 @@
_PY38 = (3, 8) <= sys.version_info < (3, 9)
_PY39 = (3, 9) <= sys.version_info < (3, 10)

# Versions for different platform-specific fixtures.
_WIN = os.name == 'nt'
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"""Checks if a file is executable."""
return os.access(filename, os.X_OK)


def is_windows() -> bool:
def is_windows() -> bool: # pragma: win
Copy link
Member

Choose a reason for hiding this comment

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

This function executes on both linux and win code, so no reason to ignore it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -219,7 +222,7 @@ def _check_executable_mismatch(
token: tokenize.TokenInfo,
*,
is_shebang: bool,
) -> None:
) -> None: # pragma: not-win
Copy link
Member

Choose a reason for hiding this comment

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

Can we move it to if is_windows() or self.filename == STDIN: line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think, we can not because testing shebang violations in this request was disabled.

def visit_comment(
self,
token: tokenize.TokenInfo,
) -> None: # pragma: not-win
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks a lot! Only a single question left!

- uses: crazy-max/ghaction-chocolatey@v1
- name: Install make
with:
args: install make
Copy link
Member

Choose a reason for hiding this comment

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

Can we merge curl and make together?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@sobolevn
Copy link
Member

@AlexandrKhabarov please, take a look at https://github.com/AlexandrKhabarov/wemake-python-styleguide/actions/runs/592660378

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

YAML can be tricky! 😅

Comment on lines 68 to 69
- uses: crazy-max/ghaction-chocolatey@v1
- name: Install curl and make
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- uses: crazy-max/ghaction-chocolatey@v1
- name: Install curl and make
- name: Install curl and make
uses: crazy-max/ghaction-chocolatey@v1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I heve not used gitlab ci actions before. Currently, I can not understand the source of the problem. I can try to investigate it later.

@codecov
Copy link

codecov bot commented Feb 23, 2021

Codecov Report

Merging #1899 (a38f140) into master (8f72647) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1899   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          115       116    +1     
  Lines         6145      6182   +37     
  Branches      1375      1375           
=========================================
+ Hits          6145      6182   +37     
Impacted Files Coverage Δ
...ke_python_styleguide/visitors/tokenize/comments.py 100.00% <ø> (ø)
wemake_python_styleguide/logic/system.py 100.00% <100.00%> (ø)
wemake_python_styleguide/constants.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f72647...a2b8d41. Read the comment docs.

@sobolevn
Copy link
Member

@AlexandrKhabarov can you please help me with fixing the CI? I don't have any experience with windows, it just scares me too much 😨

@AlexandrKhabarov
Copy link
Contributor Author

I will try to solve it soon.

@AlexandrKhabarov
Copy link
Contributor Author

I installed poetry and dependencies of the project, but now flake8 failed.

@sobolevn
Copy link
Member

This is related to https://gitlab.com/pycqa/flake8-docstrings
AFAIK, it is not tested on windows, so it might have this problem.
Or we can skrew something up on ourside, you never know 🙂

Can you please report this issue to flake8-docstrings team? It looks like a valid issue to me 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants