-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
mypy section now required in setup.cfg differs from documentation #9940
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
Comments
Hey, any timeline on when this will get fixed? Running into similar issues. |
* Refactor some *_op_helper methods into query_op_helper Done: arithmetic, comparisons. Todo: in, isa. Probably not: unify, dot. * Refactor in_op_helper to use new query_op_helper * Add add_constraint method. * Use add constraint in unify vars. * Format, fix some comments, and the tests. * Refactor dot_op_helper to use query_op_helper. * Bump flask-oso dependencies. * Fix some (but not all) JS tests. * Actually fix JS tests. This reverts commit 304dfe4, and instead fixes the underlying problem, which was that we were losing source information in sub-queries. * Fix more tests, appease 📎. * Mypy 0.800 compatibility See python/mypy#9940 * Clean up comments & error messages in add_constraint. * Move `dot_op_helper` below `query_op_helper`. * Remove misleading comments. * Fix TODO based on review suggestion. * Re-mute logs during rule selection. * Better TODO comment. * Update flask-oso oso requirement. Co-authored-by: David Hatch <[email protected]>
* Refactor some *_op_helper methods into query_op_helper Done: arithmetic, comparisons. Todo: in, isa. Probably not: unify, dot. * Refactor in_op_helper to use new query_op_helper * Add add_constraint method. * Use add constraint in unify vars. * Format, fix some comments, and the tests. * Refactor dot_op_helper to use query_op_helper. * Bump flask-oso dependencies. * Fix some (but not all) JS tests. * Actually fix JS tests. This reverts commit 304dfe4, and instead fixes the underlying problem, which was that we were losing source information in sub-queries. * Fix more tests, appease 📎. * Mypy 0.800 compatibility See python/mypy#9940 * Clean up comments & error messages in add_constraint. * Move `dot_op_helper` below `query_op_helper`. * Remove misleading comments. * Fix TODO based on review suggestion. * Re-mute logs during rule selection. * Better TODO comment. * Update flask-oso oso requirement. Co-authored-by: David Hatch <[email protected]>
For #213. Works around python/mypy#9940.
* Refactor some *_op_helper methods into query_op_helper Done: arithmetic, comparisons. Todo: in, isa. Probably not: unify, dot. * Refactor in_op_helper to use new query_op_helper * Add add_constraint method. * Use add constraint in unify vars. * Format, fix some comments, and the tests. * Refactor dot_op_helper to use query_op_helper. * Bump flask-oso dependencies. * Fix some (but not all) JS tests. * Actually fix JS tests. This reverts commit 304dfe4, and instead fixes the underlying problem, which was that we were losing source information in sub-queries. * Fix more tests, appease 📎. * Mypy 0.800 compatibility See python/mypy#9940 * Clean up comments & error messages in add_constraint. * Move `dot_op_helper` below `query_op_helper`. * Remove misleading comments. * Fix TODO based on review suggestion. * Re-mute logs during rule selection. * Better TODO comment. * Update flask-oso oso requirement. Co-authored-by: David Hatch <[email protected]>
* Refactor some *_op_helper methods into query_op_helper Done: arithmetic, comparisons. Todo: in, isa. Probably not: unify, dot. * Refactor in_op_helper to use new query_op_helper * Add add_constraint method. * Use add constraint in unify vars. * Format, fix some comments, and the tests. * Refactor dot_op_helper to use query_op_helper. * Bump flask-oso dependencies. * Fix some (but not all) JS tests. * Actually fix JS tests. This reverts commit 304dfe4, and instead fixes the underlying problem, which was that we were losing source information in sub-queries. * Fix more tests, appease 📎. * Mypy 0.800 compatibility See python/mypy#9940 * Clean up comments & error messages in add_constraint. * Move `dot_op_helper` below `query_op_helper`. * Remove misleading comments. * Fix TODO based on review suggestion. * Re-mute logs during rule selection. * Better TODO comment. * Update flask-oso oso requirement. Co-authored-by: David Hatch <[email protected]>
@electrofelix Thanks for writing this up - I've spent a chunk of time trying to understand why disabling import checking for third party libs wasn't working when configured in The way I spotted the solution was by copypasting the config into |
Also includes a workaround for python/mypy#9940.
As per #9940, a [mypy] section is now required in setup.cfg in order for config to be loaded from that file. However, the docs are out of date. This PR removes that out of date clause.
* Upgrade mypy version Also includes a workaround for python/mypy#9940. * Add additional missing types Fixes aws#1701. * Add changelog entry * Bump py from 1.5.3 to 1.10.0 Bumps [py](https://github.com/pytest-dev/py) from 1.5.3 to 1.10.0. - [Release notes](https://github.com/pytest-dev/py/releases) - [Changelog](https://github.com/pytest-dev/py/blob/master/CHANGELOG.rst) - [Commits](pytest-dev/py@1.5.3...1.10.0) Signed-off-by: dependabot[bot] <[email protected]> * Fixed mypy type declarations for AuthResponse routes (should be a List) * Fix to aws#1640 Looking at definition of ApiGateway::BasePathMapping it looks only to be a string The previous code sets up a template reference to the RestAPI but from the definition of AWS::Serverless::Api, there is only a StageName property. Looking at the model for the WebSocket custom domain, I think we just need the name of the api state only. * Updated tests to address aws#1640 * Fix type definitions for Request Fixes aws#1708. * Update pip requirement from <21.1,>=9 to >=9,<21.2 Updates the requirements on [pip](https://github.com/pypa/pip) to permit the latest version. - [Release notes](https://github.com/pypa/pip/releases) - [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst) - [Commits](pypa/pip@9.0.0...21.1) Signed-off-by: dependabot[bot] <[email protected]> * Add changelog entry for bugfix * Bumping version to 1.22.4 * Add example for testing POST views with json bodies * Add optional queue_arn to on_sqs_message This allows sqs handlers to be configured with the Chalice/CDK integration. Fixes aws#1681 * Add changelog entry for queue_arn * Update API docs with new param * Clear import cache in tests Due to Chalice using relative paths when importing an app, in Python 3.8.10, we'll use a cached version of a previous test case's sys.path location which will result in import errors, for example see: https://github.com/jamesls/chalice/runs/2529906754 The GitHub action for 3.8 upgraded from 3.8.9 to 3.8.10 which triggered this issue. It looks like this issue has been resolved upstream (https://bugs.python.org/issue44070) but we still need a fix in Chalice until a new version of 3.8 is released. Probably not a bad idea to clear the cache anyways if we're removing stuff from sys.path. * Update packager to support new manylinux tag PEP 600 defines a new "perennial tag" for manylinux going forward. Projects such as numpy have started to use this new tag, which results in Chalice being unable to package numpy. We might be able to relax how he validate valid platform tags for Lambda, but for now we roughly follow what's outlined in the "Package Installers" section in the PEP. We'll map the old manylinux tag to the new format, parse out the glibc version, and then verify it's compatible with Lambda's glibc (based on a given runtime image). The other fix need was to support multiple compatibility tags (defined in PEP 425 "Compressed Tag Sets"), which numpy was also using: numpy-1.20.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl * Bump botocore min version Needed for the lambda waiters * Wait for function state to be active when deploying We may need to explore doing batch waits in the create/update case so we don't block on each function. * Bumping version to 1.23.0 * update terraform required_version to support 0.15 and null provider v3 * added interface for WebsocketEvent * Fix missing ":" after def index() from doc's code Missing ":" from line 182 def index() return {'hello': 'world'} * Add additional attributes to WebsocketEvent * Add changelog entry for WebsocketEvent type * Add changelog entry for terraform upgrade * Fix incomplete docs on packaging the vendor dir Fixes aws#1739. * update terraform required_version to support 1.0 * Add chagnelog entry for terraform * Add source_account to aws_lambda_permission for s3 events * Update planner to include source account for S3 events * Add changelog entry for source account * Remove support for py27 This removes package dependencies for py27 as well as updates the setup.py to not support py27. We also no longer test on py27. * Fix unresolved references in the planner * Add changelog for py27 removal * Remove py2 makefile rules * Rename variables * Bumping version to 1.24.0 * Update cd.rst * fix partition error when updating API Gateway in GovCloud region * Update pip requirement from <21.2,>=9 to >=9,<21.3 Updates the requirements on [pip](https://github.com/pypa/pip) to permit the latest version. - [Release notes](https://github.com/pypa/pip/releases) - [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst) - [Commits](pypa/pip@9.0.0...21.2.1) --- updated-dependencies: - dependency-name: pip dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Upgrade sphinx to latest version The latest version of sphinx includes built-in retries to the linkchecker, which has been failing our CI builds recently. * Add test to verify we use correct partition in govcloud * Bumping version to 1.24.1 * Fix arn parsing in builtin auth response Rather that right splitting on the `:` char, which doesn't take into account `:` chars in the user provided URL, we instead parse from left splits because we know that the ARN always follows a fixed starting format. Fixes aws#1775. * Update click requirement from <8.0,>=7 to >=7,<9.0 Updates the requirements on [click](https://github.com/pallets/click) to permit the latest version. - [Release notes](https://github.com/pallets/click/releases) - [Changelog](https://github.com/pallets/click/blob/main/CHANGES.rst) - [Commits](pallets/click@7.0...8.0.0) Signed-off-by: dependabot[bot] <[email protected]> * Add changelog for click version upgrade * Avoid duplicate jobs on push/pull_request triggers * cd.rst Typo CodePipeline type fix * Bump version of attrs to latest version Also added this package to dependabot so we can pick up updates as soon as they release. Fixes aws#1768. * Update dev requirements to latest versions To make this upgrade easier in the future I've gone ahead and switched to pip-tools for tracking dev dependencies. This should also make our builds more reproducible now that we're locking all our dependencies. There some additional exclusion rules I added for the lint checkers. To support these we'd have to make some py3 specific changes, which I'd like to hold off for until a minor release. * Run CDK tests as part of the run-tests GitHub action I've set this up as a separate job under this action to isolate setting up node and the CDK to only the tests that need it. * Only run CDK tests on ubuntu We're verifying we can install and use the CDK integration, there's no platform specific tests we'd be triggering. This also helps to reduce the concurrency limits on macos jobs. * Remove expectation of failing CDK test This has now been fixed upstream. * Bumping version to 1.24.2 * Add support for Python 3.9 * Update docs to remove reference to py27 * Add changelog entry for python 3.9 * Fix doc line length error * Added MaximumBatchingWindowInSeconds aws#1778 * Fix "chalice.Response" import in middleware docs * Bumping version to 1.25.0 * Added MaximumBatchingWindowInSeconds aws#1778 Documentation updates * Fix line length lint errors * Added MaximumBatchingWindowInSeconds aws#1778 Updated awsclient.py to accept argument on create and update of lambda event source. * Add changelog entry for MaximumBatchingWindowInSeconds * Return response from websocket event source handler * Add tests. * Refactor WebsocketEventSourceHandler call method. * Fix typo responce -> response * Add docs on connection handling responses for ws * Add changelog entry * Bumping version to 1.26.0 * Stop including tests in Python wheels The current Chalice wheel on PyPI contains tests that are installed as a separate "tests" site-package. * Add support for Python 3.9 https://aws.amazon.com/about-aws/whats-new/2021/08/aws-lambda-adds-support-python-3-9/ * Pin pandas installed by tests to 1.1.5 1.1.5 is the latest version that supports both Python 3.6 and 3.9. * fix domain name format for cn region * Update pip requirement from <21.3,>=9 to >=9,<21.4 Updates the requirements on [pip](https://github.com/pypa/pip) to permit the latest version. - [Release notes](https://github.com/pypa/pip/releases) - [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst) - [Commits](pypa/pip@9.0.0...21.3) --- updated-dependencies: - dependency-name: pip dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Add latest changes to changelog * Bumping version to 1.26.1 * Fixing typo in tutorials/cdk.rst * Allow pyyaml 6.x * Add CustomAuthorizer.__init__ args to app.pyi * Add changelog entry for pyyaml bump * Add test for websocket aws-cn fix * Add changelog entry for bugfix * Bumping version to 1.26.2 * Don't repeat the Code in the Message for error responses This also makes chalice conform to the way the docs say chalice will respond. See https://aws.github.io/chalice/topics/views.html\#error-handling and look at the badrequest example. * Remove remains of a constructor that now serves no purpose This solves the useless-super-delegation linting error. * Make docs consistent regarding the way error messages are formatted aws#1339 * Add changelog entry for redundant error code fix * Update endpoint tests to work with botocore 1.23.x Verify endpoints are a subset of the data we require to account for the new variant keyword added to endpoints.json in botocore 1.23.x. Fixes aws#1850. * Bump attrs from 21.2.0 to 21.3.0 Bumps [attrs](https://github.com/python-attrs/attrs) from 21.2.0 to 21.3.0. - [Release notes](https://github.com/python-attrs/attrs/releases) - [Changelog](https://github.com/python-attrs/attrs/blob/main/CHANGELOG.rst) - [Commits](python-attrs/attrs@21.2.0...21.3.0) --- updated-dependencies: - dependency-name: attrs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * fix: add x-amazon-apigateway-endpoint-configuration if an api-gateway-endpoint-vpce is configured * Add changelog entry for VPC endpoint with REST API * Update dev reqs to latest versions * Fix version deps conflicts * Fix pylint warnings * Remove whitespace around ":" in JSON Technically valid JSON, but pygments will error out in this case (see pygments/pygments#2010) in 2.11.0. * Bumping version to 1.26.3 * Update package.py * Bump terraform required version to 0.12.26 0.11.0 is deprecated and providers (including the AWS provider) have deprecated support for it. We also can't support the `required_version` key in 0.11.x, but the older mechanism for specifying provider versions is removed in the latest terraform versions. * Add changelog entry for terraform template updates * Bumping version to 1.26.4 * Support terraform 1.1.x I see no breaking change from 1.0 to 1.1.x in terraform changelogs, https://github.com/hashicorp/terraform/blob/v1.1/CHANGELOG.md * Add changelog entry for Terraform version bump * [pkg][terraform]remove template_file provider * Sync latest policy file with latest services Also includes a fix for aws#1858. * Add changelog entry for tf template provider removal * Bumping version to 1.26.5 * Update pip requirement from <21.4,>=9 to >=9,<22.1 Updates the requirements on [pip](https://github.com/pypa/pip) to permit the latest version. - [Release notes](https://github.com/pypa/pip/releases) - [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/pip/commits) --- updated-dependencies: - dependency-name: pip dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Run CI with latest package deps We want to make sure we're pulling in the latest package versions when we bump our version dependency ranges. * Support pip v22.x Rather than opting in to each new pip version, we'll assume that this new entry point will work going forward. We're already controlling the pip versions we support in our setup.py, so right now we have to bump our pip dependency range *and* update this conditional. Now, in the case that the import string stays the same, we just have to bump the dependency range of pip. Fixes aws#1887 * Add changelog entry for pip import string fix * Bumping version to 1.26.6 * Update template requirements-dev.txt The `py.test` package on PyPI raises a ValueError in its setup.py when pip installed > ValueError: please use 'pytest' pypi package instead of 'py.test' * REST API tutorial grammar Address a few minor grammar issues. * Set a default timeout in local * fix a typo * Add test to verify default timeout for lambda context * Add changelog entry for local context bugfix * Bump upper bound of jmespath dep to 2.0 We still support python3.6 so we're keeping the lower bound to ensure that py36 will pickup jmespath 0.10.0. * enable cdk v2 integration i.e. 'chalice[cdkv2]' * update documentation to recommend using cdk version 2 * Switch cdk ddb template app to require cdk v2 * Fall back to cdk v2 before skipping cdk tests * Run CDK v1/v2 functional tests * Update tests to handle CDK version 2 * Fix doc linting issue * Add changelog entry for cdk v2 support * Update git clone to use https The `git://` protocol is no longer supported by GitHub. * Bumping version to 1.27.0 * Adds terraform packaging support for websocketapi * Fixed integration_uri * Fixed terraform package websockets lambda invoke permission resource definition * Removed incorrect comment from TerraformGenerator * Added tests for websockets_api terraform packaging * Fixed prchecks (#1) * Update pip requirement from <22.1,>=9 to >=9,<22.2 Updates the requirements on [pip](https://github.com/pypa/pip) to permit the latest version. - [Release notes](https://github.com/pypa/pip/releases) - [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst) - [Commits](pypa/pip@9.0.0...22.1) --- updated-dependencies: - dependency-name: pip dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Add changelog entry for pip version bump * Use function name as output for handler names Matches parity with the outputs of SAM template outputs for websocket APIs. * Revert formating changes AFAICT, prcheck passes without these changes. * Add changelog for tf websocket support * Add sns message attributes as extracted attributes * Add message attributes to generated sns messages * Bumping version to 1.27.1 * Add changelog entry for sns message attributes * Upgrade PyJWT to latest version This was triggering a dependenbot security scan, but this demo app was not vulnerable to the issue. * Fixes method_whitelist deprecation warning in the next version from urllib3 library * Add type definitions to app.py This allows us to remove the app.pyi file and opens up the possibility of having more specific types. * Minor typo fix * Change AWS Terraform provider constraint to allow versions 4.x * Update pip requirement from <22.2,>=9 to >=9,<22.3 Updates the requirements on [pip](https://github.com/pypa/pip) to permit the latest version. - [Release notes](https://github.com/pypa/pip/releases) - [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst) - [Commits](pypa/pip@9.0.0...22.2) --- updated-dependencies: - dependency-name: pip dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Add python3.9 to README * Bump year version of attrs package. * Remove note about py27, no longer supported * Add changelog entry for TF update * Various app runtime cleanups * Revert several refactorings in app.py This is taking a more conservative approach to these changes. * Switch stale issue closing to github actions Probot no longer works, so we need to switch over to GitHub actions. This uses the same actions as other repos in the aws org. I've disabled the ancient issues, as my immediate needs are to get parity with the old behavior, which was to close issuse that have no received a response. I've also set dry-run mode so I can have this run for a bit and verify the actions it would take make sense. * Bumping version to 1.27.2 * Remove 3.6 testing As of July 18, 2022 you can no longer creating new Lambda functions with Python 3.6 As of August 17, 2022 you can no longer update new Lambda functions with Python 3.6. * Enable stale issue github action After several dry run outputs, it's performing the expected actions so we can enable this workflow. * Update dependencies to latest versions This includes several code fixes to make the latest mypy/pylint happy as well as simplification to the requirements files. Our doc build script already installs the dev deps so we can simplify things and consolidate them all into a single requirements file. * Fix typedef for schedule decorator Fixes aws#1967. * Fix a typo * Fix version string updates The regex needed to be updated to account for the type being added. Fixes aws#1971. * Bumping version to 1.27.3 * cherrypick int branch * yank doccheck * yank type check. Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: James Saryerwinnie <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Christian Kothe <[email protected]> Co-authored-by: Mike Monaghan <[email protected]> Co-authored-by: [email protected] <aws-sdk-python-automation> Co-authored-by: Jon Beilke <[email protected]> Co-authored-by: daka83 <[email protected]> Co-authored-by: @m1ru1 <[email protected]> Co-authored-by: Jon Beilke <[email protected]> Co-authored-by: Adam Bensalah <[email protected]> Co-authored-by: Matt Messinger <[email protected]> Co-authored-by: Phill Price <[email protected]> Co-authored-by: Manuel Martinez <[email protected]> Co-authored-by: kmbotts <[email protected]> Co-authored-by: muriloviana <[email protected]> Co-authored-by: 0x7c48 <[email protected]> Co-authored-by: Illia Volochii <[email protected]> Co-authored-by: Chen <[email protected]> Co-authored-by: João Vieira <[email protected]> Co-authored-by: Dave Hall <[email protected]> Co-authored-by: darlev91 <[email protected]> Co-authored-by: Dino Hensen <[email protected]> Co-authored-by: Marco Ceppi <[email protected]> Co-authored-by: Andrew Hughes-Onslow <[email protected]> Co-authored-by: lowid <[email protected]> Co-authored-by: kbehlers <[email protected]> Co-authored-by: Mike <[email protected]> Co-authored-by: Bastien Gandouet <[email protected]> Co-authored-by: gomi_ningen <[email protected]> Co-authored-by: Stephan Fitzpatrick <[email protected]> Co-authored-by: adityamohta <[email protected]> Co-authored-by: Paul Grillenberger <[email protected]> Co-authored-by: rexes-aka <[email protected]> Co-authored-by: loesak <[email protected]> Co-authored-by: waderaku <[email protected]> Co-authored-by: Tim Penhey <[email protected]> Co-authored-by: Jean-Charles Bertin <[email protected]> Co-authored-by: yoshi-taka <[email protected]>
While I agree that this change should have been advertised better and maybe shouldn't have been made, it's been live for two and a half years, and the docs were updated in #10364 |
Bug Report
Existing setup.cfg with a section that looks like
[mypy-myapp.mymodule]
containing anignore_errors = True
setting is no longer picked up as expected by mypy 0.800.The behaviour documented at https://mypy.readthedocs.io/en/stable/config_file.html#config-file-format indicates that a section
[mypy]
is optional forsetup.cfg
files. However with a recent change it is now required.PR #9114 introduces a change to skip setup.cfg to avoid another issue where use of setup.cfg was shadowing any additional user configs covered in #9113.
To maintain compatibility with existing configs potentially the check should be:
It may be preferred to deprecate the existing documented behaviour, and be able to rely on needing there always to be a
mypy
section instead of treating setup.cfg as special. In the short term however it might be better to add a deprecation notice when this is detected and retain compatibility with existing setup.cfg that do not include an[mypy]
section for now.To Reproduce
(Write your steps here:)
[mypy]
Expected Behavior
Error should be produce for the first execution of mypy, and success reported for the latter two
Output from step 4:
Output from step 5:
Output from step 6:
Actual Behavior
Output from step 4:
Output from step 5:
Output from step 6:
Your Environment
The text was updated successfully, but these errors were encountered: