Skip to content

Commit d677047

Browse files
Create workflow to automatically update dependencies (#185)
* Migrate build process to poetry * black * change to poetry update and update deps * test workflow * uncomment version * remove poetry.lock * re-add setuptools * fix pyproject.toml and remove setup.py * add httpretty fix typo * update deps to match setup.py * add py deps to integration test * make importlib required * add lock and fix python requirements * remove unused variables Co-authored-by: DarcyRaynerDD <[email protected]>
1 parent dd23a6d commit d677047

File tree

8 files changed

+704
-57
lines changed

8 files changed

+704
-57
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ jobs:
8585
path: "**/node_modules"
8686
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
8787

88+
- name: Set up Python
89+
uses: actions/setup-python@v2
90+
with:
91+
python-version: 3.9
92+
93+
- name: Install Python dependencies
94+
run: |
95+
pip install virtualenv
96+
virtualenv venv
97+
source venv/bin/activate
98+
pip install .[dev]
99+
88100
- name: Install Serverless Framework
89101
run: sudo yarn global add serverless --prefix /usr/local
90102
- name: Install Crossbuild Deps

.github/workflows/update_deps.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: update-deps
2+
3+
on:
4+
schedule:
5+
- cron: "0 10 * * *" # Run at 10 am every day
6+
7+
jobs:
8+
check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.7
19+
20+
- name: Update Dependencies
21+
run: |
22+
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
23+
source $HOME/.poetry/env
24+
poetry build
25+
poetry update
26+
27+
- name: Create Pull Request
28+
uses: peter-evans/create-pull-request@v3
29+
with:
30+
commit-message: update dependencies
31+
title: Update Dependencies
32+
body: |
33+
Autogenerated PR to update all deps to latest versions
34+
branch: update-dependencies

datadog_lambda/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# The minor version corresponds to the Lambda layer version.
22
# E.g.,, version 0.5.0 gets packaged into layer version 5.
3-
__version__ = "3.49.0"
3+
try:
4+
import importlib.metadata as importlib_metadata
5+
except ModuleNotFoundError:
6+
import importlib_metadata
47

8+
__version__ = importlib_metadata.version(__name__)
59

610
import os
711
import logging

0 commit comments

Comments
 (0)