Skip to content

Improve build process by moving to script #63

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

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:

- name: Set up and run contract tests with pytest
run: |
bash contract-tests/set-up-contract-tests.sh
bash scripts/set-up-contract-tests.sh
pip install pytest
pytest contract-tests/tests

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- name: Set up and run contract tests with pytest
run: |
bash contract-tests/set-up-contract-tests.sh
bash scripts/set-up-contract-tests.sh
pip install pytest
pytest contract-tests/tests

Expand Down
17 changes: 3 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,10 @@ documentation, we greatly value feedback and contributions from our community.
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
information to effectively respond to your bug report or contribution.

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

## Test a sample App
Expand Down
10 changes: 5 additions & 5 deletions contract-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ The steps to add a new test for a library or framework are:

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

From `aws-otel-python-instrumentation` dir, execute:

```
./contract-tests/set-up-contract-tests.sh
Steps:
* From `aws-otel-python-instrumentation` dir, execute:
```sh
./scripts/build_and_install_distro.sh
./scripts/set-up-contract-tests.sh
pytest contract-tests/tests
```
23 changes: 23 additions & 0 deletions scripts/build_and_install_distro.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
# Check script is running in contract-tests
current_path=`pwd`
current_dir="${current_path##*/}"
if [ "$current_dir" != "aws-otel-python-instrumentation" ]; then
echo "Please run from aws-otel-python-instrumentation dir"
exit
fi

# Setup - update dependencies and create/empty dist dir
pip install --upgrade pip setuptools wheel packaging build
mkdir dist
rm -rf dist/aws_opentelemetry_distro*

# Build distro
cd aws-opentelemetry-distro
python3 -m build --outdir ../dist

# Install distro
cd ../dist
DISTRO=(aws_opentelemetry_distro-*-py3-none-any.whl)
pip install $DISTRO --force-reinstall
cd ..