summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build-python-package.yml94
-rw-r--r--doc/gf-developers.t2t2
-rw-r--r--download/index.md14
-rw-r--r--index.html10
4 files changed, 118 insertions, 2 deletions
diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml
new file mode 100644
index 000000000..45e94b853
--- /dev/null
+++ b/.github/workflows/build-python-package.yml
@@ -0,0 +1,94 @@
+name: Build & Publish Python Package
+
+on: [push, pull_request]
+
+jobs:
+ build_wheels:
+ name: Build wheel on ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: true
+ matrix:
+ os: [ubuntu-18.04, macos-latest]
+
+ steps:
+ - uses: actions/checkout@v1
+
+ - uses: actions/setup-python@v1
+ name: Install Python
+ with:
+ python-version: '3.7'
+
+ - name: Install cibuildwheel
+ run: |
+ python -m pip install cibuildwheel==1.4.2
+
+ - name: Install build tools for OSX
+ if: startsWith(matrix.os, 'macos')
+ run: |
+ brew install automake
+
+ - name: Build wheels on Linux
+ if: startsWith(matrix.os, 'macos') != true
+ env:
+ CIBW_BEFORE_BUILD: cd src/runtime/c && autoreconf -i && ./configure && make && make install
+ run: |
+ python -m cibuildwheel src/runtime/python --output-dir wheelhouse
+
+ - name: Build wheels on OSX
+ if: startsWith(matrix.os, 'macos')
+ env:
+ CIBW_BEFORE_BUILD: cd src/runtime/c && glibtoolize && autoreconf -i && ./configure && make && make install
+ run: |
+ python -m cibuildwheel src/runtime/python --output-dir wheelhouse
+
+ - uses: actions/upload-artifact@v2
+ with:
+ path: ./wheelhouse
+
+ build_sdist:
+ name: Build source distribution
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - uses: actions/setup-python@v2
+ name: Install Python
+ with:
+ python-version: '3.7'
+
+ - name: Build sdist
+ run: cd src/runtime/python && python setup.py sdist
+
+ - uses: actions/upload-artifact@v2
+ with:
+ path: ./src/runtime/python/dist/*.tar.gz
+
+ upload_pypi:
+ name: Upload to PyPI
+ needs: [build_wheels, build_sdist]
+ runs-on: ubuntu-latest
+ if: github.ref == 'refs/heads/master' && github.event_name == 'push'
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.x'
+
+ - name: Install twine
+ run: pip install twine
+
+ - uses: actions/download-artifact@v2
+ with:
+ name: artifact
+ path: ./dist
+
+ - name: Publish
+ env:
+ TWINE_USERNAME: __token__
+ TWINE_PASSWORD: ${{ secrets.pypi_password }}
+ run: |
+ (cd ./src/runtime/python && curl -I --fail https://pypi.org/project/$(python setup.py --name)/$(python setup.py --version)/) || twine upload dist/*
diff --git a/doc/gf-developers.t2t b/doc/gf-developers.t2t
index 74059199b..ed336b9a7 100644
--- a/doc/gf-developers.t2t
+++ b/doc/gf-developers.t2t
@@ -391,6 +391,8 @@ bindings are found in the ``src/runtime/python`` and ``src/runtime/java``
directories, respecively. Compile them by following the instructions in
the ``INSTALL`` files in those directories.
+The Python library can also be installed from PyPI using `pip install pgf`.
+
== Compilation of RGL ==
As of 2018-07-26, the RGL is distributed separately from the GF compiler and runtimes.
diff --git a/download/index.md b/download/index.md
index e6a1d39bc..44eb6db3c 100644
--- a/download/index.md
+++ b/download/index.md
@@ -171,6 +171,20 @@ in the RGL folder.
This assumes that you already have GF installed.
For more details about building the RGL, see the [RGL README](https://github.com/GrammaticalFramework/gf-rgl/blob/master/README.md).
+## Installing the Python bindings from PyPI
+
+The Python library is available on PyPI as `pgf`, so it can be installed using:
+
+```
+pip install pgf
+```
+
+We provide binary wheels for Linux and OSX (with Windows missing so far), which
+include the C runtime and a ready-to-go. If there is no binary distribution for
+your platform, this will install the source tarball, which will attempt to build
+the binding during installation, and requires the GF C runtime to be installed on
+your system.
+
## Older releases
- [GF 3.9](index-3.9.html) (August 2017)
diff --git a/index.html b/index.html
index 7a3a202be..a14508a0a 100644
--- a/index.html
+++ b/index.html
@@ -332,9 +332,11 @@ least one, it may help you to get a first idea of what GF is.
Afrikaans,
Amharic (partial),
Arabic (partial),
+ Basque (partial),
Bulgarian,
Catalan,
Chinese,
+ Czech (partial),
Danish,
Dutch,
English,
@@ -346,10 +348,12 @@ least one, it may help you to get a first idea of what GF is.
Greek modern,
Hebrew (fragments),
Hindi,
+ Hungarian (partial),
Interlingua,
- Japanese,
Italian,
- Latin (fragments),
+ Japanese,
+ Korean (partial),
+ Latin (partial),
Latvian,
Maltese,
Mongolian,
@@ -362,7 +366,9 @@ least one, it may help you to get a first idea of what GF is.
Romanian,
Russian,
Sindhi,
+ Slovak (partial),
Slovene (partial),
+ Somali (partial),
Spanish,
Swahili (fragments),
Swedish,