Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Han Wang authored May 21, 2022
1 parent 9fd9ce2 commit 713593e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 16 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ concurrency:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-18.04
- windows-latest
#- macos-latest
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
Expand All @@ -37,12 +40,12 @@ jobs:
- name: Install Python version
run: |
scripts/make_setup.sh 0
python scripts/make_setup.py 0
pip install -e .
- name: Install CPP version
run: |
scripts/make_setup.sh 1
python scripts/make_setup.py 1
pip install -e .
- name: Test
Expand Down Expand Up @@ -86,7 +89,7 @@ jobs:
# Don't build osx 10.6 (no C++11 support)
CIBW_SKIP: "*macosx_10_6*"
run: |
scripts/make_setup.sh 1
python scripts/make_setup.py 1
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
Expand All @@ -108,7 +111,7 @@ jobs:

- name: Build sdist
run: |
scripts/make_setup.sh 1
python scripts/make_setup.py 1
python setup.py sdist
- uses: actions/upload-artifact@v2
Expand All @@ -129,7 +132,7 @@ jobs:

- name: Build sdist
run: |
scripts/make_setup.sh 0
python scripts/make_setup.py 0
python setup.py sdist
- uses: actions/upload-artifact@v2
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ test:
python3 -bb -m pytest --reruns 2 --only-rerun 'Overflow in cast' --only-rerun 'Table or view not found' tests/

installlocal:
scripts/make_setup.sh 1
python scripts/make_setup.py 1
pip install -e .
scripts/make_setup.sh 0
python scripts/make_setup.py 0
pip install -e .

sql:
Expand Down
2 changes: 1 addition & 1 deletion fugue_sql_antlr_version/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.8"
__version__ = "0.0.9"
10 changes: 10 additions & 0 deletions scripts/make_setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import sys

mode = bool(int(sys.argv[1]))

with open("setup.py", "w") as f:
f.writelines(
["# pylint: disable-all\n", "# flake8: noqa\n", f"_BUILD_CPP = {mode}\n\n"]
)
with open("setup.template", "r") as ff:
f.writelines(ff.readlines())
3 changes: 0 additions & 3 deletions scripts/make_setup.sh

This file was deleted.

5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pylint: disable-all
# flake8: noqa
_BUILD_CPP = bool(0)
_BUILD_CPP = False

import fnmatch
import os
import platform
Expand Down Expand Up @@ -53,7 +54,7 @@ def get_ext_modules() -> List[str]:
if not _BUILD_CPP:
return []
extra_compile_args = {
"windows": ["/DANTLR4CPP_STATIC", "/Zc:__cplusplus"],
"windows": ["/DANTLR4CPP_STATIC", "/Zc:__cplusplus", "/std:c++17"],
"linux": ["-std=c++17"],
"darwin": ["-std=c++17"],
"cygwin": ["-std=c++17"],
Expand Down
2 changes: 1 addition & 1 deletion setup.template
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_ext_modules() -> List[str]:
if not _BUILD_CPP:
return []
extra_compile_args = {
"windows": ["/DANTLR4CPP_STATIC", "/Zc:__cplusplus"],
"windows": ["/DANTLR4CPP_STATIC", "/Zc:__cplusplus", "/std:c++17"],
"linux": ["-std=c++17"],
"darwin": ["-std=c++17"],
"cygwin": ["-std=c++17"],
Expand Down

0 comments on commit 713593e

Please sign in to comment.