Skip to content

Commit f81d6bc

Browse files
eustascopybara-github
authored andcommitted
Modernize tests.
Avoid file IO. Drive-by: drop bro.py and bro_test.py; we do not support it well and likely no one uses it. PiperOrigin-RevId: 834206605
1 parent fa925d0 commit f81d6bc

File tree

10 files changed

+207
-690
lines changed

10 files changed

+207
-690
lines changed

.github/workflows/build_test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ jobs:
137137
build_system: python
138138
python_version: "3.10"
139139
# TODO: investigate why win-builds can't run tests
140-
py_setuptools_cmd: build_ext
141140
os: windows-2022
142141

143142
- name: maven
@@ -333,8 +332,9 @@ jobs:
333332
run: |
334333
python -VV
335334
python -c "import sys; sys.exit('Invalid python version') if '.'.join(map(str,sys.version_info[0:2])) != '${{ matrix.python_version }}' else True"
336-
pip install setuptools==51.3.3
337-
python setup.py ${{ matrix.py_setuptools_cmd || 'test'}}
335+
pip install setuptools==51.3.3 pytest
336+
python setup.py build_ext --inplace
337+
pytest ./python/tests
338338
339339
build_test_dotnet:
340340
name: Build and test with .NET

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ include c/include/brotli/*.h
99
include LICENSE
1010
include MANIFEST.in
1111
include python/_brotli.cc
12-
include python/bro.py
1312
include python/brotli.py
1413
include python/README.md
1514
include python/tests/*

python/README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
This directory contains the code for the Python `brotli` module,
2-
`bro.py` tool, and roundtrip tests.
2+
and roundtrip tests.
33

4-
Only Python 2.7+ is supported.
4+
Only Python 3.10+ is supported.
55

66
We provide a `Makefile` to simplify common development commands.
77

@@ -17,13 +17,17 @@ following command from this directory:
1717

1818
$ make install
1919

20-
If you already have native Brotli installed on your system and want to use this one instead of the vendored sources, you
21-
should set the `USE_SYSTEM_BROTLI=1` environment variable when building the wheel, like this:
20+
If you already have native Brotli installed on your system and want to use
21+
this one instead of the vendored sources, you should set
22+
the `USE_SYSTEM_BROTLI=1` environment variable when building the wheel,
23+
like this:
2224

2325
$ USE_SYSTEM_BROTLI=1 pip install brotli --no-binary brotli
2426

25-
Brotli is found via the `pkg-config` utility. Moreover, you must build all 3 `brotlicommon`, `brotlienc`, and `brotlidec`
26-
components. If you're installing brotli from the package manager, you need the development package, like this on Fedora:
27+
Brotli is found via the `pkg-config` utility. Moreover, you must build
28+
all 3 `brotlicommon`, `brotlienc`, and `brotlidec` components. If you're
29+
installing brotli from the package manager, you need the development package,
30+
like this on Fedora:
2731

2832
$ dnf install brotli brotli-devel
2933

@@ -45,8 +49,8 @@ able to edit the source files, you can use the `setuptools`
4549

4650
### Code Style
4751

48-
Brotli's code follows the [Google Python Style Guide][]. To
49-
automatically format your code, first install [YAPF][]:
52+
Brotli code follows the [Google Python Style Guide][].
53+
To automatically format your code, first install [YAPF][]:
5054

5155
$ pip install yapf
5256

@@ -56,7 +60,6 @@ Then, to format all files in the project, you can run:
5660

5761
See the [YAPF usage][] documentation for more information.
5862

59-
6063
[PyPI]: https://pypi.org/project/Brotli/
6164
[development mode]: https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode
6265
[Google Python Style Guide]: https://google.github.io/styleguide/pyguide.html

python/bro.py

Lines changed: 0 additions & 194 deletions
This file was deleted.

0 commit comments

Comments
 (0)