-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Levi Vande Kamp
committed
Apr 15, 2022
1 parent
d92efdd
commit a1bf7b4
Showing
4 changed files
with
83 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ A Python 3 interface for code by Cristian Ioan Vasile <[email protected]> from http | |
See the original readme, pyTWTL-readme.txt, for information on pyTWTL. | ||
|
||
This package can be installed directly from GitHub: | ||
``` | ||
```bash | ||
pip install git+https://github.com/levivk/pyTWTL-python3@master | ||
``` | ||
## Usage | ||
|
@@ -17,3 +17,67 @@ alphabet = out['alphabet'] # The alphabet set | |
dfa_normal = out['normal'] # The normal dfa | ||
dfa_relaxed = out['infinity'] # The relaxed dfa | ||
``` | ||
|
||
## How to build | ||
|
||
If you want to use this on a different architecture or otherwise run into problems that requires rebundling the Python 2 code, below is how you do that. | ||
|
||
### Ubuntu | ||
|
||
This method runs a Ubuntu 18.04 docker container and runs pyinstaller there. No need to install Python 2. | ||
|
||
```bash | ||
# install git, and docker | ||
sudo apt install git docker.io -y | ||
|
||
# clone this repository | ||
git clone https://github.com/levivk/pyTWTL-python3 | ||
cd pyTWTL-python3/pyinstaller_build | ||
|
||
# run the build script | ||
./build.sh | ||
|
||
# run the test | ||
./test.sh | ||
|
||
# You should get a few hundred lines of yaml output and no errors | ||
``` | ||
|
||
### MacOS | ||
|
||
Tested on macOS Catalina Version 10.15.7 and Monterey Version 12.3 | ||
|
||
```bash | ||
# install homebrew https://brew.sh/ | ||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
|
||
# install pyenv | ||
brew install pyenv | ||
echo 'eval "$(pyenv init --path)"' >> ~/.zprofile | ||
echo 'eval "$(pyenv init -)"' >> ~/.zshrc | ||
|
||
# Now close your shell and reopen it | ||
|
||
# install python 2.7 with dev libraries | ||
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 2.7.18 | ||
pyenv global 2.7.18 | ||
|
||
# clone this repository | ||
git clone https://github.com/levivk/pyTWTL-python3 | ||
cd pyTWTL-python3/pyinstaller_build | ||
|
||
# install dependencies | ||
pip install -r requirements.txt | ||
|
||
# run the build script | ||
bash build.sh | ||
|
||
# run the test | ||
bash test.sh | ||
|
||
# You should get a few hundred lines of yaml output and no errors | ||
|
||
# Uninstall python 2.7 | ||
pyenv global system | ||
pyenv uninstall 2.7.18 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
#! /bin/bash | ||
cd $(dirname $0) | ||
./dist/twtl_translate/twtl_translate "[H^1 r2]^[0,10]" --kind=both | ||
|
||
# cd to script dir | ||
cd $(dirname $0) | ||
|
||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then | ||
../pyTWTL/bin-linux/twtl_translate "[H^1 r2]^[0,10]" --kind=both | ||
elif [[ "$OSTYPE" == "darwin"* ]]; then | ||
../pyTWTL/bin-darwin/twtl_translate "[H^1 r2]^[0,10]" --kind=both | ||
else | ||
echo "Unsupported OS type:" "$OSTYPE" | ||
fi |