Skip to content

Commit a0cec8f

Browse files
authored
Merge branch 'main' into main
2 parents 5bff39b + d285b7f commit a0cec8f

File tree

5 files changed

+32
-1
lines changed

5 files changed

+32
-1
lines changed

.github/workflows/test.yml

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
# opentelemetry-python-contrib which is compatible with these Core repo
1212
# changes.
1313
CONTRIB_REPO_SHA: 9ce1c26d2732dfbdadbb492fc38c562dcd08ed2e
14+
1415
# This is needed because we do not clone the core repo in contrib builds anymore.
1516
# When running contrib builds as part of core builds, we use actions/checkout@v4 which
1617
# does not set an environment variable (simply just runs tox), which is different when
@@ -19,6 +20,9 @@ env:
1920
# from within the contrib build.
2021
CORE_REPO_SHA: ${{ github.sha }}
2122

23+
# See #3879 and https://pip.pypa.io/en/stable/cli/pip/#exists-action-option
24+
PIP_EXISTS_ACTION: w
25+
2226
jobs:
2327
build:
2428
env:

.pre-commit-config.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
repos:
2+
- repo: https://github.com/psf/black-pre-commit-mirror
3+
rev: 24.3.0
4+
hooks:
5+
- id: black
6+
language_version: python3.11
7+
- repo: https://github.com/pycqa/isort
8+
rev: 5.12.0
9+
hooks:
10+
- id: isort
11+
- repo: https://github.com/pycqa/flake8
12+
rev: '6.1.0'
13+
hooks:
14+
- id: flake8

CONTRIBUTING.md

+12
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ An easier way to do so is:
6161
1. Run `.tox/lint/bin/black .`
6262
2. Run `.tox/lint/bin/isort .`
6363

64+
Or you can call formatting and linting in one command by [pre-commit](https://pre-commit.com/):
65+
66+
```console
67+
$ pre-commit
68+
```
69+
70+
You can also configure it to run lint tools automatically before committing with:
71+
72+
```console
73+
$ pre-commit install
74+
```
75+
6476
We try to keep the amount of _public symbols_ in our code minimal. A public symbol is any Python identifier that does not start with an underscore.
6577
Every public symbol is something that has to be kept in order to maintain backwards compatibility, so we try to have as few as possible.
6678

dev-requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ asgiref==3.7.2
1919
psutil==5.9.6
2020
GitPython==3.1.41
2121
flaky==3.7.0
22+
pre-commit==3.7.0

scripts/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ DISTDIR=dist
1616
mkdir -p $DISTDIR
1717
rm -rf ${DISTDIR:?}/*
1818

19-
for d in opentelemetry-api/ opentelemetry-sdk/ opentelemetry-proto/ opentelemetry-semantic-conventions/ exporter/*/ shim/opentelemetry-opentracing-shim/ propagator/*/ tests/opentelemetry-test-utils/; do
19+
for d in opentelemetry-api/ opentelemetry-sdk/ opentelemetry-proto/ opentelemetry-semantic-conventions/ exporter/*/ shim/*/ propagator/*/ tests/opentelemetry-test-utils/; do
2020
(
2121
echo "building $d"
2222
cd "$d"

0 commit comments

Comments
 (0)