-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
5.0.0 fails with flake8 #406
Comments
It's a known issue that flake8 relies on the deprecated interfaces removed in importlib_metadata 5. I've attempted to engage with the maintainers of that project, but they refuse to engage and dismiss my proposals without suggesting alternatives. Flake8 does declare a dependency on I do see that I can replicate the issue with
Even though flake8 pins importlib_metadata on Python 3.7, pip installs importlib_metadata 5. Interestingly, if I install only
I guess there may be an issue with how pip resolves dependencies of dependencies. Oh, I see a difference. When installing |
There's nothing that can be done here from the perspective of importlib_metadata. The deprecation has been in place since Feb 2021 and other projects have been able to adapt to the transition. These issues were anticipated and socialized and this project has worked actively with affected projects to provide multiple avenues to navigate the transition. I'm still willing to help flake8 support the preferred interfaces. What's not going to happen is to undo the deprecation or restore support for these deprecated interfaces indefinitely (or for many years). As a user of flake8, your best option is probably to preemptively install |
…bute 'get' python/importlib_metadata#406 This reverts commit a37f302. Traceback (most recent call last): File "~/cihai/cihai-cli/.venv/bin/flake8", line 8, in <module> sys.exit(main()) File "~/cihai/cihai-cli/.venv/lib/python3.7/site-packages/flake8/main/cli.py", line 22, in main app.run(argv) File "~/cihai/cihai-cli/.venv/lib/python3.7/site-packages/flake8/main/application.py", line 363, in run self._run(argv) File "~/cihai/cihai-cli/.venv/lib/python3.7/site-packages/flake8/main/application.py", line 350, in _run self.initialize(argv) File "~/cihai/cihai-cli/.venv/lib/python3.7/site-packages/flake8/main/application.py", line 330, in initialize self.find_plugins(config_finder) File "~/cihai/cihai-cli/.venv/lib/python3.7/site-packages/flake8/main/application.py", line 153, in find_plugins self.check_plugins = plugin_manager.Checkers(local_plugins.extension) File "~/cihai/cihai-cli/.venv/lib/python3.7/site-packages/flake8/plugins/manager.py", line 357, in __init__ self.namespace, local_plugins=local_plugins File "~/cihai/cihai-cli/.venv/lib/python3.7/site-packages/flake8/plugins/manager.py", line 238, in __init__ self._load_entrypoint_plugins() File "~/cihai/cihai-cli/.venv/lib/python3.7/site-packages/flake8/plugins/manager.py", line 254, in _load_entrypoint_plugins eps = importlib_metadata.entry_points().get(self.namespace, ()) AttributeError: 'EntryPoints' object has no attribute 'get'
@jaraco @xqt I filed an issue on the flake8 side here: PyCQA/flake8#1701 Workaround is as @jaraco says above, pin |
`importlib-metadata 5.0.0` breaks `flake8`, causing CI to fail. `importlib` recommends constraining `importlib < 5` until flake8 adapts. python/importlib_metadata#406 (comment)
* Tests fail on python3.7 because of a problem with the importlib_metadata package. The issue was fixed using the workaround suggsted here: python/importlib_metadata#406 (comment)
- Causes xarray netcdf load error - See python/importlib_metadata#406
* Updated readthedocs install method * Pin importlib_metadata to < v5 - Causes xarray netcdf load error - See python/importlib_metadata#406 * Update .readthedocs.yaml * Update requirements.txt * Update conf.py
There is a compatibility issue with importlib-metadata and flake8 [1]. [1] python/importlib_metadata#406
There is a compatibility issue between importlib-metadata 5.0.0 and flake8 under Python 3.7 [1]. [1] python/importlib_metadata#406
There is a compatibility issue between importlib-metadata 5.0.0 and flake8 under Python 3.7 [1]. [1] python/importlib_metadata#406
There is a compatibility issue between importlib-metadata 5.0.0 and flake8 under Python 3.7 [1]. [1] python/importlib_metadata#406
There is a compatibility issue between importlib-metadata 5.0.0 and flake8 under Python 3.7 [1]. [1] python/importlib_metadata#406
CI lints for python3.7 were failing due to an issue with flake8 (related to python/importlib_metadata#406); see the example test failure below. The failure is resolved by ensuring that the installed version of flake8 is >= 4.0. <details> ```text nox > [2023-04-14 23:08:38,999] Running session lint-3.7 nox > [2023-04-14 23:08:39,000] Creating virtual environment (virtualenv) using python3.7 in .nox/lint-3-7 nox > [2023-04-14 23:08:39,252] python -m pip install --upgrade 'setuptools<=66' pip nox > [2023-04-14 23:08:43,005] python -m pip install -r requirements/dev.txt -e . nox > [2023-04-14 23:09:01,123] mypy . --strict --install-types --non-interactive nox > [2023-04-14 23:09:16,755] isort . --check nox > [2023-04-14 23:09:17,201] black --check . nox > [2023-04-14 23:09:21,432] flake8 Traceback (most recent call last): File "/home/circleci/project/.nox/lint-3-7/bin/flake8", line 8, in <module> sys.exit(main()) File "/home/circleci/project/.nox/lint-3-7/lib/python3.7/site-packages/flake8/main/cli.py", line 22, in main app.run(argv) File "/home/circleci/project/.nox/lint-3-7/lib/python3.7/site-packages/flake8/main/application.py", line 363, in run self._run(argv) File "/home/circleci/project/.nox/lint-3-7/lib/python3.7/site-packages/flake8/main/application.py", line 350, in _run self.initialize(argv) File "/home/circleci/project/.nox/lint-3-7/lib/python3.7/site-packages/flake8/main/application.py", line 330, in initialize self.find_plugins(config_finder) File "/home/circleci/project/.nox/lint-3-7/lib/python3.7/site-packages/flake8/main/application.py", line 153, in find_plugins self.check_plugins = plugin_manager.Checkers(local_plugins.extension) File "/home/circleci/project/.nox/lint-3-7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 357, in __init__ self.namespace, local_plugins=local_plugins File "/home/circleci/project/.nox/lint-3-7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 238, in __init__ self._load_entrypoint_plugins() File "/home/circleci/project/.nox/lint-3-7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 254, in _load_entrypoint_plugins eps = importlib_metadata.entry_points().get(self.namespace, ()) AttributeError: 'EntryPoints' object has no attribute 'get' nox > [2023-04-14 23:09:21,536] Command flake8 failed with exit code 1 nox > [2023-04-14 23:09:21,537] Session lint-3.7 failed. ``` </details>
Try installing older version of importlib_metadata for python/importlib_metadata#406
Try installing older version of importlib_metadata due to python/importlib_metadata#406
Remove python 3.7 from test matrix, conflict in flake8 dependencies. Refer to: python/importlib_metadata#406
Remove python 3.7 from test matrix, conflict in flake8 dependencies. Refer to: python/importlib_metadata#406
Flake8 3.x uses a deprecated interface that was removed in `importlib-metadata` 5 (python/importlib_metadata#406).
See python/importlib_metadata#406 for explanation
* Cleanup whitespace in README. * GitHub Actions: Add Py3.10, update Actions, more flake8 tests "3.10" must be quoted in yaml https://dev.to/hugovk/the-python-3-1-problem-85g * Test on Python 3.11 beta 5 * Reduce max line length in flake8 to the default of 79. * Update authors and changelog. * Update actions in codeql workflow. * Fix INDICATOR keyword * docs: Add a PiPY package badge * Acknowledge support for Python 3.10 A subset of andialbrecht#645 Follow on to andialbrecht#661 * DIV is Operator * added some builtin types that can appear in Spark create table statements. * Don't make slice copies in TokenList._token_matching(). Since we are working with indexes anyway, don't bother calling enumerate() with a slice from self.tokens (which requires copying memory). Instead, just generate the indexes using range() and use normal indexing to access the desired tokens. The old behavior resulted in quadratic runtime with respect to the number of tokens, which significantly impacted performance for statements with very large numbers of tokens. With the new behavior, the runtime is now linear with respect to the number of tokens. * Refactor to reduce redundant code. * Add regex pattern to identify REGEXP as a Compasion token * Make tzcast grouping function less eager * Update authors and changelog. * Add DISTINCTROW keyword (fixes andialbrecht#677). * Update Changelog. * CREATE TABLE tbl AS SELECT should return get_alias() for its column * Update Changelog. * Fixed bad parsing of create table statements that use lower case * Update CHANGELOG. yeah... I promise to make fewer commits like that in the future... * add backtick to remove_quotes character list * Update Changelog and authors. * Add tests for utils.remove_quotes. * Add docstring and comments. * Allow any unicode character as identifier name (fixes andialbrecht#641). * Bump version. * Switch back to development mode. * Revert "add regex pattern to identify IN as a Compasion token" This reverts commit 28c4d40. See andialbrecht#694. The expectation is that IN is primarily recognized as a keyword, although it acts as a comparison operator. This also matches the definition of IN in most SQL syntax references where it is listed as a reserved keyword (PostgreSQL: https://www.postgresql.org/docs/current/sql-keywords-appendix.html, MySQL: https://dev.mysql.com/doc/refman/8.0/en/keywords.html, for example). * Update changelog. * Update workflow runner. * Update tested Python versions in workflow. * Setup a nightly build, even without changes in the module itself. * Fix schedule trigger syntax. * Switch to pyproject.toml (fixes andialbrecht#685). * configurable syntax * test configurable syntax * remove type annotations for python 3.5 compatibility * test for changing the regex * lexer documentation * flake8 * additional documentation * change singleton behavior * Fix get_type with comments between WITH keyword * Cleanup regex for detecting keywords (fixes andialbrecht#709). * CI: Use codecov action. codecov module is deprecated and was removed from PyPI in favor of the github action. * Remove unnecessary parts in regex for bad escaping. The regex tried to deal with situations where escaping in the SQL to be parsed was suspicious. * Testing branch * Removed test file * Bump version. * Update Changelog. * Switch back to development mode. * Update python-app.yml: Try with 3.12-beta1 * Update python-app.yml: Revert to 3.12-dev and add check-latest * Add classifier for Python 3.11 (fixes andialbrecht#726). * Remove outdated and unused editorconfig. * Drop support for Python 3.5. * Get tox running again. We have to pin versions for tox and virtualenv because newer versions don't support Python 3.6 anymore. * Don't pin virtualenv in dev section. The requirements in dev section are more general (and may require newer versions). * Add reminder for github release (fixes andialbrecht#732). * Update issue templates * Update bug_report.md * Add link to discussion when creating issues. * Update config.yml. * Update test action. * Add Code of Conduct. * Add contributing guide. * Create SECURITY.md * Add Pull request template. * Update Python version in test action. * Updated too early... switching back to 3.12.0-beta.4. * CI: Try to fix importlib issue with flake8. See python/importlib_metadata#406 * Bump GitHub Actions * Add support for Python 3.12 * Update changelog and authors. * Ignore attributes starting with dunder in _TokenType (fixes andialbrecht#672). This issue came up, when trying to deepcopy a parsed statement. deepcopy uses getattr(obj, '__deepcopy__', None) to get a method for copying an object. Before this change a new attribute '__deepcopy__' was created as a new instance of _TokenType (a tuple). * Simplify regex. * Code cleanup. --------- Co-authored-by: Andi Albrecht <albrecht.andi@gmail.com> Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: osmnv <80402144+osmnv@users.noreply.github.com> Co-authored-by: Hao Xin <haoxinst@gmail.com> Co-authored-by: Aki Ariga <chezou+github@gmail.com> Co-authored-by: Simon Heisterkamp <she@delegate.dk> Co-authored-by: Daniel Harding <dharding@living180.net> Co-authored-by: JavierPan <PeterSandwich@users.noreply.github.com> Co-authored-by: Erik Cederstrand <erik@adamatics.com> Co-authored-by: Long Le Xich <codenamelxl@users.noreply.github.com> Co-authored-by: Simon Heisterkamp <simon@heisterkamp.dk> Co-authored-by: Shikanime Deva <deva.shikanime@protonmail.com> Co-authored-by: Kevin Stubbings <kwstubbs@github.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Summary: Update flake8 version to avoid a dependency error (see python/importlib_metadata#406). Also fix any outstanding flake8 issues. The broken cpu/gpu tests are being fixed in D50850008 and D50707779. Differential Revision: D50849894
Summary: Pull Request resolved: #162 Update flake8 version to avoid a dependency error (see python/importlib_metadata#406). Also fix any outstanding flake8 issues. The broken cpu/gpu tests are being fixed in D50850008 and D50707779. Reviewed By: JKSenthil Differential Revision: D50849894 fbshipit-source-id: 1bd8e961d42d24a5faaf9934343f52b0e2c70e80
…age for ubuntu-latest bump flake version to work around importlib issue python/importlib_metadata#406
Due to using annotations we can only support python versions from 3.7 onwards so it's possible to allow all pytest versions >= 7.1.0. Step up flake8 to at least 4.0 to overcome the issue desribed at below link: python/importlib_metadata#406
The new import_meta_data 5.0.0 fails with hacking flake8 extension:
See CI test here
It works with the previous release 4.13.0:
The text was updated successfully, but these errors were encountered: