mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-03-23 02:35:49 +08:00
Merge branch 'master' into pubsync
This commit is contained in:
commit
aa17af5632
31
.github/workflows/ci.yml
vendored
31
.github/workflows/ci.yml
vendored
@ -8,14 +8,37 @@ on:
|
|||||||
- cron: '0 12 * * *'
|
- cron: '0 12 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
|
||||||
|
# We run most of our testing on linux but it should apply to mac too;
|
||||||
|
# we can always add an explicit mac job if it seems worthwhile.
|
||||||
|
ci_unix:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: 3.7
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: tools/snippets install_pip_reqs
|
||||||
sudo apt-get -y install python3.7 python3.7-dev python3-pip python3-setuptools
|
|
||||||
tools/snippets install_pip_reqs
|
|
||||||
- name: Run checks and tests
|
- name: Run checks and tests
|
||||||
run: make -j2 check test
|
run: make -j2 check test
|
||||||
|
|
||||||
|
# Most of our toolset doesn't work on raw windows (outside of WSL).
|
||||||
|
# However, it's nice to at least run unit tests there since some behavior
|
||||||
|
# (filesystem, etc) can vary significantly.
|
||||||
|
ci_windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: 3.7
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install pytest
|
||||||
|
- name: Run tests
|
||||||
|
run: python tools/snippets pytest -v tests
|
||||||
|
|
||||||
|
|||||||
1
.idea/dictionaries/ericf.xml
generated
1
.idea/dictionaries/ericf.xml
generated
@ -308,6 +308,7 @@
|
|||||||
<w>completecmd</w>
|
<w>completecmd</w>
|
||||||
<w>compounddict</w>
|
<w>compounddict</w>
|
||||||
<w>compoundlist</w>
|
<w>compoundlist</w>
|
||||||
|
<w>conditionalize</w>
|
||||||
<w>configerror</w>
|
<w>configerror</w>
|
||||||
<w>confighash</w>
|
<w>confighash</w>
|
||||||
<w>configkey</w>
|
<w>configkey</w>
|
||||||
|
|||||||
@ -29,6 +29,7 @@ from __future__ import annotations
|
|||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import platform
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
@ -37,7 +38,7 @@ if TYPE_CHECKING:
|
|||||||
from typing_extensions import Literal
|
from typing_extensions import Literal
|
||||||
|
|
||||||
# Python binary assumed by these tools.
|
# Python binary assumed by these tools.
|
||||||
PYTHON_BIN = 'python3.7'
|
PYTHON_BIN = 'python3.7' if platform.system() != 'Windows' else 'python'
|
||||||
|
|
||||||
MIT_LICENSE = """Copyright (c) 2011-2020 Eric Froemling
|
MIT_LICENSE = """Copyright (c) 2011-2020 Eric Froemling
|
||||||
|
|
||||||
|
|||||||
@ -443,6 +443,7 @@ def compile_python_files() -> None:
|
|||||||
|
|
||||||
def pytest() -> None:
|
def pytest() -> None:
|
||||||
"""Run pytest with project environment set up properly."""
|
"""Run pytest with project environment set up properly."""
|
||||||
|
import platform
|
||||||
from efrotools import get_config, PYTHON_BIN
|
from efrotools import get_config, PYTHON_BIN
|
||||||
|
|
||||||
# Grab our python paths for the project and stuff them in PYTHONPATH.
|
# Grab our python paths for the project and stuff them in PYTHONPATH.
|
||||||
@ -450,7 +451,8 @@ def pytest() -> None:
|
|||||||
if pypaths is None:
|
if pypaths is None:
|
||||||
raise CleanError('python_paths not found in project config.')
|
raise CleanError('python_paths not found in project config.')
|
||||||
|
|
||||||
os.environ['PYTHONPATH'] = ':'.join(pypaths)
|
separator = ';' if platform.system() == 'Windows' else ':'
|
||||||
|
os.environ['PYTHONPATH'] = separator.join(pypaths)
|
||||||
|
|
||||||
# Also tell Python interpreters not to write __pycache__ dirs everywhere
|
# Also tell Python interpreters not to write __pycache__ dirs everywhere
|
||||||
# which can screw up our builds.
|
# which can screw up our builds.
|
||||||
|
|||||||
@ -26,6 +26,7 @@ from typing import TYPE_CHECKING
|
|||||||
import tempfile
|
import tempfile
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import logging
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Any, Type, Dict, Optional, List, Union
|
from typing import Any, Type, Dict, Optional, List, Union
|
||||||
@ -180,8 +181,17 @@ def static_type_equals(value: Any, statictype: Union[Type, str]) -> bool:
|
|||||||
a match (for instance, if mypy outputs 'builtins.int*' it will match
|
a match (for instance, if mypy outputs 'builtins.int*' it will match
|
||||||
the 'int' type passed in as statictype).
|
the 'int' type passed in as statictype).
|
||||||
"""
|
"""
|
||||||
|
import platform
|
||||||
from inspect import getframeinfo, stack
|
from inspect import getframeinfo, stack
|
||||||
|
|
||||||
|
# NOTE: don't currently support windows here; just going to always
|
||||||
|
# pass so we don't have to conditionalize all our individual test
|
||||||
|
# locations.
|
||||||
|
if platform.system() == 'Windows':
|
||||||
|
logging.debug('static_type_equals not supported on windows;'
|
||||||
|
' will always pass...')
|
||||||
|
return True
|
||||||
|
|
||||||
# We don't actually use there here; we pull them as strings from the src.
|
# We don't actually use there here; we pull them as strings from the src.
|
||||||
del value
|
del value
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user