Skip to content

Commit 75313b6

Browse files
authored
Update scripts and lint configs (#2929)
1 parent 41b9e26 commit 75313b6

File tree

9 files changed

+18
-33
lines changed

9 files changed

+18
-33
lines changed

.coveragerc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[run]
22
omit =
33
*/tests/*
4-
*/setup.py
54
*/gen/*

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ exclude =
2424
docs/examples/opentelemetry-example-app/build/*
2525
opentelemetry-proto/build/*
2626
opentelemetry-proto/src/opentelemetry/proto/
27+
*/build/lib/*

RELEASING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ A `hotfix` is defined as a small change developed to correct a bug that should b
8383
3. On your local machine, update `CHANGELOG.md` with the date of the hotfix change.
8484
4. With administrator privileges for PyPi, manually publish the affected packages.
8585
1. Install [twine](https://pypi.org/project/twine/) and [build](https://pypi.org/project/build/)
86-
2. Navigate to where the `setup.py` or `pyproject.toml` file exists for the package you want to publish.
87-
3. To build the package:
88-
- If a `setup.py` file exists, run `python setup.py sdist bdist_wheel`. You may have to install [wheel](https://pypi.org/project/wheel/) as well.
89-
- Otherwise, run `python -m build`.
86+
2. Navigate to where the `pyproject.toml` file exists for the package you want to publish.
87+
3. To build the package: run `python -m build`.
9088
4. Validate your built distributions by running `twine check dist/*`.
9189
5. Upload distributions to PyPi by running `twine upload dist/*`.
9290
5. Note that since hotfixes are manually published, the build scripts for publish after creating a release are not run.

eachdist.ini

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@ packages=
4141
opentelemetry-test-utils
4242
tests
4343

44-
[experimental]
45-
version=1.10a0
46-
47-
packages=
48-
opentelemetry-exporter-prometheus-remote-write
49-
opentelemetry-api
50-
opentelemetry-sdk
51-
opentelemetry-exporter-otlp-proto-grpc
52-
opentelemetry-exporter-otlp-proto-http
53-
opentelemetry-exporter-otlp
54-
5544
[lintroots]
5645
extraroots=examples/*,scripts/
5746
subglob=*.py,tests/,test/,src/*,examples/*

opentelemetry-api/src/opentelemetry/propagate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
``opentelemetry.trace.propagation.tracecontext.TraceContextTextMapPropagator``
2828
and other of type ``opentelemetry.baggage.propagation.W3CBaggagePropagator``.
2929
Notice that these propagator classes are defined as
30-
``opentelemetry_propagator`` entry points in the ``setup.cfg`` file of
30+
``opentelemetry_propagator`` entry points in the ``pyproject.toml`` file of
3131
``opentelemetry``.
3232
3333
Example::

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ exclude = '''
55
/( # generated files
66
.tox|
77
venv|
8+
.*/build/lib/.*|
89
exporter/opentelemetry-exporter-jaeger-proto-grpc/src/opentelemetry/exporter/jaeger/proto/grpc/gen|
910
exporter/opentelemetry-exporter-jaeger-thrift/src/opentelemetry/exporter/jaeger/thrift/gen|
1011
exporter/opentelemetry-exporter-zipkin-proto-http/src/opentelemetry/exporter/zipkin/proto/http/v2/gen|
11-
opentelemetry-proto/src/opentelemetry/proto/.*/.*
12+
opentelemetry-proto/src/opentelemetry/proto/.*/.*|
13+
scripts
1214
)/
1315
)
1416
'''

scripts/build.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ DISTDIR=dist
2121
echo "building $d"
2222
cd "$d"
2323
# Some ext directories (such as docker tests) are not intended to be
24-
# packaged. Verify the intent by looking for a setup.py.
25-
if [ -f setup.py ]; then
26-
python3 setup.py sdist --dist-dir "$BASEDIR/dist/" clean --all
27-
else if [ -f pyproject.toml ]; then
28-
HATCH_BUILD_CLEAN=1 python3 -m build --outdir "$BASEDIR/dist/"
24+
# packaged. Verify the intent by looking for a pyproject.toml.
25+
if [ -f pyproject.toml ]; then
26+
python3 -m build --outdir "$BASEDIR/dist/"
2927
fi
3028
)
3129
done

scripts/coverage.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ function cov {
66
if [ ${TOX_ENV_NAME:0:4} == "py34" ]
77
then
88
pytest \
9-
--ignore-glob=*/setup.py \
109
--ignore-glob=instrumentation/opentelemetry-instrumentation-opentracing-shim/tests/testbed/* \
1110
--cov ${1} \
1211
--cov-append \
@@ -15,7 +14,6 @@ function cov {
1514
${1}
1615
else
1716
pytest \
18-
--ignore-glob=*/setup.py \
1917
--cov ${1} \
2018
--cov-append \
2119
--cov-branch \

scripts/eachdist.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def parse_args(args=None):
8181
commands according to `format` and `--all`.
8282
8383
Target paths are initially all Python distribution root paths
84-
(as determined by the existence of setup.py, etc. files).
84+
(as determined by the existence of pyproject.toml, etc. files).
8585
They are then augmented according to the section of the
8686
`PROJECT_ROOT/eachdist.ini` config file specified by the `--mode` option.
8787
@@ -518,18 +518,18 @@ def lint_args(args):
518518

519519
runsubprocess(
520520
args.dry_run,
521-
("black", ".") + (("--diff", "--check") if args.check_only else ()),
521+
("black", "--config", "pyproject.toml", ".") + (("--diff", "--check") if args.check_only else ()),
522522
cwd=rootdir,
523523
check=True,
524524
)
525525
runsubprocess(
526526
args.dry_run,
527-
("isort", ".")
527+
("isort", "--settings-path", ".isort.cfg", ".")
528528
+ (("--diff", "--check-only") if args.check_only else ()),
529529
cwd=rootdir,
530530
check=True,
531531
)
532-
runsubprocess(args.dry_run, ("flake8", rootdir), check=True)
532+
runsubprocess(args.dry_run, ("flake8", "--config", ".flake8", rootdir), check=True)
533533
execute_args(
534534
parse_subargs(
535535
args, ("exec", "pylint {}", "--all", "--mode", "lintroots")
@@ -629,7 +629,7 @@ def update_dependencies(targets, version, packages):
629629
for pkg in packages:
630630
update_files(
631631
targets,
632-
"setup.cfg",
632+
"pyproject.toml",
633633
rf"({basename(pkg)}.*)==(.*)",
634634
r"\1== " + version,
635635
)
@@ -694,19 +694,19 @@ def test_args(args):
694694

695695

696696
def format_args(args):
697-
format_dir = str(find_projectroot())
697+
root_dir = format_dir = str(find_projectroot())
698698
if args.path:
699699
format_dir = os.path.join(format_dir, args.path)
700700

701701
runsubprocess(
702702
args.dry_run,
703-
("black", "."),
703+
("black", "--config", f"{root_dir}/pyproject.toml", "."),
704704
cwd=format_dir,
705705
check=True,
706706
)
707707
runsubprocess(
708708
args.dry_run,
709-
("isort", "--profile", "black", "."),
709+
("isort", "--settings-path", f"{root_dir}/.isort.cfg", "--profile", "black", "."),
710710
cwd=format_dir,
711711
check=True,
712712
)

0 commit comments

Comments
 (0)