Skip to content

Commit 29dc485

Browse files
committed
Improve build process by moving to script
1 parent 12c070b commit 29dc485

File tree

4 files changed

+31
-19
lines changed

4 files changed

+31
-19
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,10 @@ documentation, we greatly value feedback and contributions from our community.
66
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
77
information to effectively respond to your bug report or contribution.
88

9-
## Build a Wheel file locally
10-
**First time setup**
9+
## Build and install distro locally
10+
From `aws-otel-python-instrumentation` dir, execute:
1111
```sh
12-
pip install --upgrade pip setuptools wheel packaging build
13-
mkdir -p ./dist
14-
```
15-
**Updating the wheel file**
16-
```sh
17-
rm -rf ./dist/*
18-
cd ./aws-opentelemetry-distro
19-
python3 -m build --outdir ../dist
20-
cd ../dist
21-
pkg_version=$(grep '__version__' ../aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py | awk -F '"' '{print $2}')
22-
pip install aws_opentelemetry_distro-${pkg_version}-py3-none-any.whl --force-reinstall
23-
cd ..
12+
./scripts/build_and_install_distro.sh
2413
```
2514

2615
## Test a sample App

contract-tests/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ The steps to add a new test for a library or framework are:
3232

3333
Pre-requirements:
3434
* Have `docker` installed and running - verify by running the `docker` command.
35-
* Ensure the `aws_opentelemetry_distro` wheel file exists in to `aws-otel-python-instrumentation/dist` folder
3635

37-
From `aws-otel-python-instrumentation` dir, execute:
38-
39-
```
40-
./contract-tests/set-up-contract-tests.sh
36+
Steps:
37+
* From `aws-otel-python-instrumentation` dir, execute:
38+
```sh
39+
./scripts/build_and_install_distro.sh
40+
./scripts/set-up-contract-tests.sh
4141
pytest contract-tests/tests
4242
```

scripts/build_and_install_distro.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# Check script is running in contract-tests
3+
current_path=`pwd`
4+
current_dir="${current_path##*/}"
5+
if [ "$current_dir" != "aws-otel-python-instrumentation" ]; then
6+
echo "Please run from aws-otel-python-instrumentation dir"
7+
exit
8+
fi
9+
10+
# Setup - update dependencies and create/empty dist dir
11+
pip install --upgrade pip setuptools wheel packaging build
12+
mkdir dist
13+
rm -rf dist/aws_opentelemetry_distro*
14+
15+
# Build distro
16+
cd aws-opentelemetry-distro
17+
python3 -m build --outdir ../dist
18+
19+
# Install distro
20+
cd ../dist
21+
DISTRO=(aws_opentelemetry_distro-*-py3-none-any.whl)
22+
pip install $DISTRO --force-reinstall
23+
cd ..

0 commit comments

Comments
 (0)