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

have code-style-fixer(PEP8) as a dev tool available #86

Closed
jkowalleck opened this issue Dec 5, 2021 · 1 comment · Fixed by #93
Closed

have code-style-fixer(PEP8) as a dev tool available #86

jkowalleck opened this issue Dec 5, 2021 · 1 comment · Fixed by #93
Labels
QA Quality Assurance

Comments

@jkowalleck
Copy link
Member

jkowalleck commented Dec 5, 2021

currently the code goes trough a pep8 test via flake8 that must be passed in CI

as a developer i want a tool available, that automatically fixes my code according to pep8


options:


I, @jkowalleck, prefer autopep8 as it fixes pep8 only. black is to much opinionated.

@jkowalleck jkowalleck added the QA Quality Assurance label Dec 5, 2021
@jkowalleck
Copy link
Member Author

jkowalleck commented Dec 9, 2021


proposal:

  • have autopep8 as a tool available in poetry-dev-env
  • have autopep8 configured -- see below
  • have the use of autopep8 mentioned i the CONTRIBUTING docs

proposed config:

  • acc/crit: autopep8 reformated code passes current flake8 rules
  • autopep8 is desinged to find existing flake8 config and use it - so config should be no issue
  • optional: use an own file .flake8 instead of tox.ini

outcome: autopep8 conflicts with existing dependencies

$ poetry add --dev autopep8                                                                                                        
Using version ^1.6.0 for autopep8

  SolverProblemError

  Because no versions of autopep8 match >1.6.0,<2.0.0
   and autopep8 (1.6.0) depends on pycodestyle (>=2.8.0), autopep8 (>=1.6.0,<2.0.0) requires pycodestyle (>=2.8.0).
  And because flake8 (3.9.2) depends on pycodestyle (>=2.7.0,<2.8.0)
   and no versions of flake8 match >3.9.2,<4.0.0, autopep8 (>=1.6.0,<2.0.0) is incompatible with flake8 (>=3.9.2,<4.0.0).
  So, because cyclonedx-python-lib depends on both flake8 (^3.9.2) and autopep8 (^1.6.0), version solving failed.

this issue is originally caused by cyclonedx-python-lib dependencies:

$ poetry add --dev autopep8 flake8                                                                                                 1280ms  2021-12-09 11:32:55
Using version ^1.6.0 for autopep8
Using version ^4.0.1 for flake8

  SolverProblemError

  Because no versions of flake8 match >4.0.1,<5.0.0
   and flake8 (4.0.1) depends on importlib-metadata (<4.3), flake8 (>=4.0.1,<5.0.0) requires importlib-metadata (<4.3).
  So, because cyclonedx-python-lib depends on both importlib-metadata (^4.8.1) and flake8 (^4.0.1), version solving failed.

looks like our won dependencies block the setup.
see #44


🎱 next would be to setup flake8 and others in a version that is compatible to flake8 v4 - to reflect latest development
this should allow install of autopep8

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

Successfully merging a pull request may close this issue.

1 participant