mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Running the scripts with this package leads to the following cryptic error in our CI, when run in macOS:
```
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
(and Python's docs clearly state that this `freeze_support` function has no effect when invoked on any operating system other than Windows ¯\_(ツ)_/¯ )
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: Test Textual module
|
|
|
|
on: [pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
python-version: ["3.7", "3.8", "3.9"]
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
architecture: x64
|
|
- name: Install and configure Poetry
|
|
uses: snok/install-poetry@v1.1.6
|
|
with:
|
|
version: 1.1.6
|
|
virtualenvs-in-project: true
|
|
- name: Install dependencies
|
|
run: poetry install
|
|
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
|
- name: Format check with black
|
|
run: |
|
|
source $VENV
|
|
make format-check
|
|
# - name: Typecheck with mypy
|
|
# run: |
|
|
# source $VENV
|
|
# make typecheck
|
|
- name: Test with pytest
|
|
run: |
|
|
source $VENV
|
|
pytest tests -v --cov=./src/textual --cov-report=xml:./coverage.xml --cov-report term-missing
|
|
- name: Quick e2e smoke test
|
|
run: |
|
|
source $VENV
|
|
python e2e_tests/sandbox_basic_test.py basic 2.0
|
|
- name: Upload code coverage
|
|
uses: codecov/codecov-action@v1.0.10
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
file: ./coverage.xml
|
|
name: rich
|
|
flags: unittests
|
|
env_vars: OS,PYTHON
|