Commit Graph

11 Commits

Author SHA1 Message Date
Eli Schwartz 6a1427401c
tests: add a python test for bytecode compilation
Some tweaks are added to the test case so that it supports python2 as
well.
2023-05-02 19:28:35 -04:00
Eli Schwartz 0e7fb07f91
python module: add an automatic byte-compilation step
For all source `*.py` files installed via either py.install_sources() or
an `install_dir: py.get_install_dir()`, produce `*.pyc` files at install
time. Controllable via a module option.
2023-05-02 19:28:35 -04:00
Eli Schwartz 9d98b4cb84
test that python modules nominally compile without warnings
Because we poke around with the dependency, so we might introduce some,
and have at least once.
2023-03-28 15:15:45 -04:00
Eli Schwartz aa84c55bef
tests: fix edge case where non-default python is used, by skipping it
In a couple of python module tests, we try to test things that rely on
the default python being the same one we look up in the python module.
This is unsolvable for the deprecated python3 module, as it actually
uses the in-process version of python for everything. For the python
module, we could actually look up the default system python instead of
the one we are running with, but then we wouldn't be testing the
functionality of that alternative python... and also the install
manifest tests would see files installed for the wrong version of
python, and report a combination of missing+extra files...

Solve both tests by just skipping the parts we cannot check.
2022-11-14 19:16:57 -05:00
Eli Schwartz 22dcb692ad python module: implicitly add python dep to extensions
If there isn't a preexisting dependency on python, append one. It's
almost assuredly needed, so just do the right thing out of the box.
2022-06-19 21:44:17 +03:00
Eli Schwartz 1f46b4ce64
tests: python module should install files correctly
- default to python site-packages
- subdir to site-packages/subdir
- arbitrary install_dir
2021-08-18 17:58:30 -04:00
Eli Schwartz 6a0fabc647
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04 17:16:11 -05:00
Michael Hirsch c9d8d4628e
simplify/correct test logic
before this, tests were being skipped on Ubuntu 20.04 with Anaconda Python
Now, all 5 tests success
2020-07-12 09:53:26 -04:00
Michael Hirsch 895de87b90
some python test cases don't care about backend, so run them in any case 2020-07-12 09:12:16 -04:00
Michael Hirsch 4f1a240bc2
raise SystemExit() generally preferred to sys.exit(1) 2020-07-12 09:08:04 -04:00
Dylan Baker 978e6fb88f tests: Add tests for the python module
This doesn't touch everything as it's just based on the python3 module
tests, ported to the python module. It's still better than the one very
basic test in the unit test module.
2018-12-12 12:23:37 -08:00