michael-k
Repos
324
Followers
44
Following
42

Per object permissions for Django

3294
527

Python library for AWS Access Policy Language creation

383
95

The Web framework for perfectionists with deadlines.

67495
27388

troposphere - Python library to create AWS CloudFormation descriptions

4779
1410

Various Dockerfiles I use on the desktop and on servers.

12869
2229

Git extension for versioning large files

10854
1679

Events

False positive E3004 circular dependency for `AWS::Serverless::Function.DeploymentPreference.Alarms`

CloudFormation Lint Version

cfn-lint 0.72.0

What operating system are you using?

Linux

Describe the bug

When AWS::Serverless::Function references an alarm in its DeploymentPreference.Alarms and the AWS::CloudWatch::Alarm references the function (eg. in Dimensions), a E3004 Circular dependency error is reported by cfn-lint. Afaik this is a valid use case.

This was introduced in cfn-lint 0.72.0 (0.71.1 did not report E3004), most likely as part of PR aws-cloudformation/cfn-lint#2452.

E3004 Circular Dependencies for resource TestFunction. Circular dependency with [LatestVersionErrorMetricGreaterThanZeroAlarm]
template.yaml:5:3

E3004 Circular Dependencies for resource LatestVersionErrorMetricGreaterThanZeroAlarm. Circular dependency with [TestFunction]
template.yaml:28:3

(The template is based on https://gist.github.com/alexcasalboni/242071568a6adde805027345cfbb6d99. But we first noticed this in one of our production functions when upgrading cfn-lint to 0.72.0.)

Expected behavior

No E3004 is reported.

Reproduction template

AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Resources:

  TestFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: index.test
      Runtime: nodejs16.x
      MemorySize: 128
      Timeout: 30
      Tracing: Active
      CodeUri: ./
      Events:
        GetResource:
          Type: Api
          Properties:
            Path: /test
            Method: get
            RestApiId: !Ref 'Api'
      
      AutoPublishAlias: live
      DeploymentPreference:
        Type: Linear10PercentEvery1Minute
        Alarms:
          - !Ref LatestVersionErrorMetricGreaterThanZeroAlarm

  LatestVersionErrorMetricGreaterThanZeroAlarm:
    Type: AWS::CloudWatch::Alarm
    Properties:
      AlarmName: alarm-sam-demo-latestversion
      AlarmDescription: "alarm to check for errors in the function"
      ComparisonOperator: GreaterThanOrEqualToThreshold
      TreatMissingData: missing
      Dimensions:
        - Name: FunctionName
          Value: !Ref TestFunction
        - Name: Resource
          Value: !Join [":", [!Ref TestFunction, !Select ["7", !Split [":", !Ref TestFunction.Version]]]]
      EvaluationPeriods: 1
      MetricName: Errors
      Namespace: AWS/Lambda
      Period: 60
      Statistic: Sum
      Threshold: 1

  Api:
    Type: AWS::Serverless::Api
    Properties:
      StageName: foo
      TracingEnabled: true

  LogGroup:
    Type: AWS::Logs::LogGroup
    Properties:
      LogGroupName: !Sub
        - /aws/lambda/${FunctionName}
        - FunctionName: !Ref 'TestFunction'
      RetentionInDays: 1
    DeletionPolicy: Delete
    UpdateReplacePolicy: Delete
Created at 3 days ago
issue comment
Use v1 of GitHub action `pypa/gh-action-pypi-publish`

You're linking a "three-dot diff" performed in the wrong direction.

Let me rephrase: At the moment there are no new commits in release/v1 compared to master.

But you're right, I should have checked the other way as well. :+1:

Created at 4 days ago
delete branch
michael-k delete branch pypi-publish
Created at 4 days ago
pull request opened
Use v1 of GitHub action `pypa/gh-action-pypi-publish`

The master branch version has been sunset, see https://github.com/pypa/gh-action-pypi-publish#-master-branch-sunset-

At the moment there's no diff between master and release/v1, see https://github.com/pypa/gh-action-pypi-publish/compare/master...release/v1

Contributor checklist
  • [x] Provided the tests for the changes.
  • [x] Assure PR title is short, clear, and good to be included in the user-oriented changelog
Maintainer checklist
  • [ ] Assure one of these labels is present: backwards incompatible, feature, enhancement, deprecation, bug, dependency, docs or skip-changelog as they determine changelog listing.
  • [ ] Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).
Created at 6 days ago
create branch
michael-k create branch pypi-publish
Created at 6 days ago

Replace master with main branch (#1740)

Replace master with main where possible (#1739)

Co-authored-by: Sorin Sbarnea sorin.sbarnea@gmail.com

pre-commit autoupdate (#1741)

updates:

Created at 6 days ago
started
Created at 1 week ago
delete branch
michael-k delete branch gh-actions
Created at 1 week ago
delete branch
michael-k delete branch master-to-main
Created at 1 week ago
pull request opened
Replace `master` with `main` where possible

I've noticed that the default branch has been renamed from master to main. This PR

  • cleans up all places that reference pip-tool's default branch,
  • uses the branch main of other repos where possible (eg. actions/checkout), and
  • let the tests use main instead of master for mocked repositories.

The word “master” remains in 3 places:

  • https://github.com/jazzband/pip-tools/blob/6839a6497d8dd752417c0945e74a15c24c279ef0/.github/workflows/release.yml#L39
  • https://github.com/jazzband/pip-tools/blob/6839a6497d8dd752417c0945e74a15c24c279ef0/docs/conf.py#L1
  • https://github.com/jazzband/pip-tools/blob/6839a6497d8dd752417c0945e74a15c24c279ef0/docs/index.rst#L1
Contributor checklist
  • [x] Provided the tests for the changes.
  • [x] Assure PR title is short, clear, and good to be included in the user-oriented changelog
Maintainer checklist
  • [ ] Assure one of these labels is present: backwards incompatible, feature, enhancement, deprecation, bug, dependency, docs or skip-changelog as they determine changelog listing.
  • [ ] Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).
Created at 1 week ago
create branch
michael-k create branch master-to-main
Created at 1 week ago

Bump click minimum version to >= 8 (#1733)

Generate hashes for all available candidates (#1723)

Generate hashes covering the PyPi index as well as additional candidates available through an extra index of find-links. Currently if PyPi index is available the hashes will be limited to those available in it.

Speedup tests using --no-build-isolation (#1735)

Improve punctuation/grammar with header. (#1547)

Co-authored-by: Hugo van Kemenade hugovk@users.noreply.github.com Co-authored-by: Albert Tugushev albert@tugushev.ru Co-authored-by: Sorin Sbarnea sorin.sbarnea@gmail.com

Fix CI tests on Windows against pip main branch (#1736)

Get hash from link

Update piptools/repositories/pypi.py

Co-authored-by: Albert Tugushev albert@tugushev.ru

Created at 1 week ago

Adding pyproject.toml file (#1643)

Co-authored-by: Albert Tugushev albert@tugushev.ru Co-authored-by: Sorin Sbarnea sorin.sbarnea@gmail.com

Bump click minimum version to >= 8 (#1733)

Generate hashes for all available candidates (#1723)

Generate hashes covering the PyPi index as well as additional candidates available through an extra index of find-links. Currently if PyPi index is available the hashes will be limited to those available in it.

Speedup tests using --no-build-isolation (#1735)

Improve punctuation/grammar with header. (#1547)

Co-authored-by: Hugo van Kemenade hugovk@users.noreply.github.com Co-authored-by: Albert Tugushev albert@tugushev.ru Co-authored-by: Sorin Sbarnea sorin.sbarnea@gmail.com

Fix CI tests on Windows against pip main branch (#1736)

Created at 1 week ago

↑ auto update requirements

Created at 1 week ago
delete branch
michael-k delete branch winky
Created at 1 week ago
pull request closed
Bump requirements
Created at 1 week ago

Update piptools/repositories/pypi.py

Co-authored-by: Albert Tugushev albert@tugushev.ru

Created at 1 week ago
Created at 1 week ago
issue comment
Implement PEP3134 to discover underlying problems with python3

I saw both issues and read through them, but that doesn't explain why this is an issue in the first place. A simple re-raise should not omit parts of the stacktrace. In pynamodb/PynamoDB#1073 you said that you “disable[d] AWS X-ray to get the proper root cause to popup.” Did you also try it with this patch and X-Ray enabled? I'm not convinced that this actually solves your problem.

Maybe X-Ray accessing the stacktrace has something to do with it? I played around with that, but found no hint that would support this theory. But my toy stacktraces were small.

From raise's documentation:

Changed in version 3.11: If the traceback of the active exception is modified in an except clause, a subsequent raise statement re-raises the exception with the modified traceback. Previously, the exception was re-raised with the traceback it had when it was caught.

getsentry/sentry-python#1626 mentions Python 3.9, therefore the re-raise shouldn't have changed the traceback.

Created at 1 week ago
issue comment
Implement PEP3134 to discover underlying problems with python3

@lehmat I've never seen raise e from e where both the exception and the cause are the same. When playing with that in IPython, I don't see any benefit either. Instead it adds a lot of noise:

Python 3.11.0 (main, Nov 12 2022, 07:10:51) [GCC 11.2.1 20220219]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.6.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: try:
   ...:     raise ValueError("foo")
   ...: except ValueError as exc:
   ...:     print("bar")
   ...:     raise exc from exc
   ...:
bar
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
    [... skipping hidden 1 frame]

Cell In [1], line 5
      4 print("bar")
----> 5 raise exc from exc

Cell In [1], line 2
      1 try:
----> 2     raise ValueError("foo")
      3 except ValueError as exc:

ValueError: foo

The above exception was the direct cause of the following exception:

ValueError                                Traceback (most recent call last)
    [... skipping hidden 1 frame]

Cell In [1], line 5
      4 print("bar")
----> 5 raise exc from exc

Cell In [1], line 2
      1 try:
----> 2     raise ValueError("foo")
      3 except ValueError as exc:

ValueError: foo

The above exception was the direct cause of the following exception:

ValueError                                Traceback (most recent call last)
Cell In [1], line 5
      3 except ValueError as exc:
      4     print("bar")
----> 5     raise exc from exc

Cell In [1], line 2
      1 try:
----> 2     raise ValueError("foo")
      3 except ValueError as exc:
      4     print("bar")

ValueError: foo

PEP 3134 doesn't mention such a use case either. Can you elaborate?

In [2]: raise ValueError("foo")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In [2], line 1
----> 1 raise ValueError("foo")

ValueError: foo
In [3]: try:
   ...:     raise ValueError("foo")
   ...: except ValueError as exc:
   ...:     print("bar")
   ...:     raise exc
   ...:
bar
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In [3], line 5
      3 except ValueError as exc:
      4     print("bar")
----> 5     raise exc

Cell In [3], line 2
      1 try:
----> 2     raise ValueError("foo")
      3 except ValueError as exc:
      4     print("bar")

ValueError: foo
Created at 1 week ago
Node v18 Released

For CodeBuild see aws/aws-codebuild-docker-images#580

Created at 1 week ago
pull request opened
Upgrade GitHub Actions actions

And set up dependabot to take care of them in the future.

This resolves deprecation warnings:

Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: actions/checkout@v2, actions/setup-python@v2

I copied the dependabot config from django/channels#1944

Created at 1 week ago
create branch
michael-k create branch gh-actions
Created at 1 week ago

Run tests against Python 3.11 and add trove classifier (#446)

[pre-commit.ci] pre-commit autoupdate (#448)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

[pre-commit.ci] pre-commit autoupdate (#452)

updates:

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

Created at 1 week ago
issue comment
Get hash from link

Can it be rebased with the latest changes?

Done

Created at 1 week ago

Adding pyproject.toml file (#1643)

Co-authored-by: Albert Tugushev albert@tugushev.ru Co-authored-by: Sorin Sbarnea sorin.sbarnea@gmail.com

Get hash from link

Created at 1 week ago
Node v18 Released

Release 1.65.0 of AWS SAM CLI comes with support for Node.js 18.x.

Created at 1 week ago

use tmp_path for test_override_newline

Fix some EncodingWarnings in python 3.10 (PEP 597) (#1614)

Merge branch 'master' into tmp-path-fixture

Merge pull request #1694 from graingert/tmp-path-fixture

use tmp_path for test_override_newline

Update README.rst

Test Python 3.11 final

Add 3.11 Trove classifier

Merge pull request #1708 from hugovk/test-3.11

Add support for Python 3.11 final

Add regression test for GH-1647 (#1687)

For Windows support, this includes workarounds for https://github.com/python/cpython/issues/85815.

Fix inconsistent handling of constraints comments with backtracking resolver (#1713)

update readme link

Merge branch 'master' into upd

Merge pull request #1716 from jazzband/upd

Use HTTPS in a readme link

Document use of the backtracking resolver (#1718)

Merge branch 'master' into patch-1

Merge pull request #1701 from Kludex/patch-1

Created at 1 week ago