Skip to content

Commit

Permalink
Remove all prototype Python code and tests
Browse files Browse the repository at this point in the history
This code and tests have been moved to lfortran.py.
  • Loading branch information
certik committed Aug 7, 2020
1 parent 63d415b commit 4ea1f06
Show file tree
Hide file tree
Showing 74 changed files with 29 additions and 9,079 deletions.
106 changes: 28 additions & 78 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ prepare tarball:
stage: tarball
image: registry.gitlab.com/lfortran/ci-images:prepare-1.7.0
script:
- export CLASSPATH="$HOME/antlr-4.7-complete.jar:$CLASSPATH"
- ./build0.sh
- python setup.py sdist
- ci/upload_tarball.sh
Expand Down Expand Up @@ -42,31 +41,6 @@ azure:
variables:
- $SSH_PRIVATE_KEY_AZURE


# Test full dependencies when a C compiler is available and used for linking
full:
stage: build
image: registry.gitlab.com/lfortran/ci-images:full-1.7.0
script:
- export PATH="$HOME/conda_root/bin:$PATH"
- conda install -c conda-forge python-clang
- tar xzf dist/lfortran-${lfortran_version}.tar.gz
- cd lfortran-${lfortran_version}
- pip install --no-index -v .
- cd ..
- rm -r lfortran lfortran-${lfortran_version}
- rm lfort
- py.test --pyargs lfortran
- python show_ast.py
- lfort examples/expr2.f90 -o a.out
- ./a.out
- ./test_lfort_cmdline gfortran
- ./test_lfort_cmdline lfort
- ./test_lfort gfortran
- ./test_lfort lfort
- cd integration_tests/interop
- ./run.sh

# Test the C++ version
cxx:
stage: build
Expand Down Expand Up @@ -185,27 +159,27 @@ build.xsh:
- xonsh ci/build.xsh

# Build and upload documentation
documentation:
stage: build
image: registry.gitlab.com/lfortran/ci-images:jupyter-1.7.0
script:
- sudo apt-get update
- sudo apt-get install -yq --no-install-recommends openssh-client
- export PATH="$HOME/conda_root/bin:$PATH"
- pip install nbconvert mkdocs
- tar xzf dist/lfortran-${lfortran_version}.tar.gz
- cd lfortran-${lfortran_version}
- pip install --no-index -v .
- cd ..
- rm -r lfortran lfortran-${lfortran_version}
- cd doc
- python convert_nb.py
- mkdocs build -s
- ../ci/upload_docs.sh
artifacts:
paths:
- doc/site
when: always
#documentation:
# stage: build
# image: registry.gitlab.com/lfortran/ci-images:jupyter-1.7.0
# script:
# - sudo apt-get update
# - sudo apt-get install -yq --no-install-recommends openssh-client
# - export PATH="$HOME/conda_root/bin:$PATH"
# - pip install nbconvert mkdocs
# - tar xzf dist/lfortran-${lfortran_version}.tar.gz
# - cd lfortran-${lfortran_version}
# - pip install --no-index -v .
# - cd ..
# - rm -r lfortran lfortran-${lfortran_version}
# - cd doc
# - python convert_nb.py
# - mkdocs build -s
# - ../ci/upload_docs.sh
# artifacts:
# paths:
# - doc/site
# when: always

# Update the downloads page
downloads_update:
Expand All @@ -226,39 +200,15 @@ minimal:
- tar xzf dist/lfortran-${lfortran_version}.tar.gz
- cd lfortran-${lfortran_version}
- export CFLAGS="-I/usr/include/x86_64-linux-musl/"
- pip install --no-index -v .
- cd ..
- rm -r lfortran lfortran-${lfortran_version}
- rm lfort
#- pip install --no-index -v .
#- cd ..
#- rm -r lfortran lfortran-${lfortran_version}
#- rm lfort
- sudo apt-get remove -yq gcc g++ libc6-dev
- sudo apt-get autoremove -yq
- py.test --pyargs lfortran
- lfort --ld-musl examples/expr2.f90 -o a.out
- ./a.out

# Test Jupyter notebooks
jupyter:
stage: build
image: registry.gitlab.com/lfortran/ci-images:jupyter-1.7.0
script:
- export PATH="$HOME/conda_root/bin:$PATH"
- tar xzf dist/lfortran-${lfortran_version}.tar.gz
- cd lfortran-${lfortran_version}
- pip install --no-index -v .
- cd ..
- rm -r lfortran lfortran-${lfortran_version}
- (git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/lfortran/fortran_kernel && cd fortran_kernel && git checkout v0.1.4 && pip install --no-index . && cd .. && rm -r fortran_kernel)
- python -m fortran_kernel.install --sys-prefix
- jupyter kernelspec list --json
- cd share/lfortran/nb
- py.test --pyargs lfortran
- jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=60 --output Demo_out.ipynb Demo.ipynb
- ls -l output1.png
artifacts:
paths:
- share/lfortran/nb/Demo_out.ipynb
- share/lfortran/nb/output1.png
when: always
#- py.test --pyargs lfortran
#- lfort --ld-musl examples/expr2.f90 -o a.out
#- ./a.out

# Test Bison grammar
grammar:
Expand Down
12 changes: 0 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,6 @@ if (WITH_STACKTRACE)
set(HAVE_LFORTRAN_STACKTRACE yes)
endif()


# Python
set(WITH_PYTHON no CACHE BOOL "Build with Python wrappers")
if (WITH_PYTHON)
cmake_minimum_required(VERSION 3.12.4 FATAL_ERROR)
find_package(Python REQUIRED COMPONENTS Interpreter Development)
endif()

enable_testing()

message("\n")
Expand All @@ -151,10 +143,6 @@ message("WITH_STACKTRACE: ${WITH_STACKTRACE}")
message("HAVE_LFORTRAN_DEMANGLE: ${HAVE_LFORTRAN_DEMANGLE}")
message("WITH_LLVM: ${WITH_LLVM}")
message("WITH_JSON: ${WITH_JSON}")
message("WITH_PYTHON: ${WITH_PYTHON}")


add_subdirectory(src)
if (WITH_PYTHON)
add_subdirectory(lfortran/parser)
endif()
2 changes: 0 additions & 2 deletions build.bat

This file was deleted.

11 changes: 0 additions & 11 deletions build0.bat

This file was deleted.

11 changes: 1 addition & 10 deletions build0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
set -e
set -x

# Generate a Fortran AST from AST.asdl (Python)
python grammar/asdl_py.py
# Generate a Fortran AST from AST.asdl (C++)
python grammar/asdl_cpp.py
# Generate a Fortran ASR from ASR.asdl
python grammar/asdl_py.py grammar/ASR.asdl lfortran/asr/asr.py ..ast.utils
# Generate a Fortran ASR from ASR.asdl (C++)
python grammar/asdl_cpp.py grammar/ASR.asdl src/lfortran/asr.h

Expand All @@ -17,9 +13,4 @@ python grammar/asdl_cpp.py grammar/ASR.asdl src/lfortran/asr.h
(cd src/lfortran/parser && bison -Wall -d -r all parser.yy)

grep -n "'" src/lfortran/parser/parser.yy && echo "Single quote not allowed" && exit 1

(cd lfortran/parser && cython -3 -I. cparser.pyx)

# Generate a parse tree from fortran.g4
antlr4="java org.antlr.v4.Tool"
(cd grammar && $antlr4 -Dlanguage=Python3 -no-listener -visitor fortran.g4 -o ../lfortran/parser)
echo "OK"
7 changes: 0 additions & 7 deletions build1.bat

This file was deleted.

17 changes: 0 additions & 17 deletions build_java.sh

This file was deleted.

9 changes: 0 additions & 9 deletions grammar/README.md

This file was deleted.

Loading

0 comments on commit 4ea1f06

Please sign in to comment.