-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add python and JS building and publishing
- Loading branch information
1 parent
09c1e0f
commit 1311185
Showing
13 changed files
with
248 additions
and
42 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
language: java | ||
|
||
os: linux | ||
dist: bionic | ||
jdk: oraclejdk8 | ||
|
||
branches: | ||
only: | ||
- horis-ci | ||
|
||
before_install: | ||
- sudo apt install -y python3-dev | ||
|
||
install: true | ||
|
||
env: ORG_GRADLE_PROJECT_python_include_path=/usr/include/python3.6m | ||
|
||
script: ./gradlew build |
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 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 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# datalorePlot JS library. | ||
|
||
## Building | ||
|
||
* build project with Gradle (`./gradlew build`) | ||
|
||
* take library files in `js-package/build/dist` directory | ||
|
||
|
||
## Publishing in Bintray CDN | ||
|
||
* set `bintray_user` and `bintray_api_key` in `gradle.properties` with your Bintray credentials | ||
|
||
* run `:js-package:bintrayUpload` gradle task (`./gradlew :js-package:bintrayUpload`) |
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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- twine must be installed (pip install twine) | ||
|
||
- set `pypi_username` and `pypi_password` properties in gradle.properties file. | ||
|
||
- if needed set `python_repository_url` property in gradle.properties file. | ||
|
||
- build project (gradle) | ||
|
||
- run publishPythonPackage gradle task from python-package module (./gradlew :python-package:publishPythonPackage) |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# datalore-plot Python package | ||
|
||
## Building | ||
|
||
* install `python-dev` package (if you use Anaconda it's already installed) | ||
|
||
* install python `setuptools` (run `pip install setuptools`) | ||
|
||
* set `python_include_path` in `gradle.properties`. | ||
For getting this path you can run `python -c "from sysconfig import get_paths as gp; print(gp()['include'])"`. | ||
|
||
* check if `python_bin_path` in `gradle.properties` contents true path to your python bin path (default is `/usr/bin`). | ||
For getting this path you can run `python -c "from sysconfig import get_paths as gp; print(gp()['scripts'])"`. | ||
|
||
* build project with Gradle (run `./gradlew build`) | ||
|
||
|
||
## Local installing | ||
|
||
* build package | ||
|
||
* run `:python-package:localInstallPythonPackage` gradle task (`./gradlew :python-package:localInstallPythonPackage`) | ||
|
||
|
||
## Publishing | ||
|
||
* build package | ||
|
||
* set `pypi_username` and `pypi_password` in `gradle.properties` with your PyPI credentials | ||
|
||
* set `python_repository_url` in `gradle.properties` if you need publish to not standard PyPI repository (i.e. `https://test.pypi.org/legacy/` for testing publishing). | ||
|
||
* run `:python-package:publishPythonPackage` |
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
plugins { | ||
id 'kotlin-multiplatform' | ||
} | ||
|
||
def PYTHON_BIN_PATH_PROPERTY = 'python_bin_path' | ||
def PYTHON_REPOSITORY_URL_PROPERTY = 'python_repository_url' | ||
|
||
if (hasProperty('python_include_path')) { | ||
if (hasProperty(PYTHON_BIN_PATH_PROPERTY)) { | ||
|
||
|
||
task updateJs(type:Exec) { | ||
workingDir project.projectDir | ||
|
||
commandLine "${project.properties[PYTHON_BIN_PATH_PROPERTY]}/python3", 'setup.py', 'update_js' | ||
} | ||
|
||
task buildPythonPackage(type:Exec) { | ||
workingDir project.projectDir | ||
|
||
commandLine "${project.properties[PYTHON_BIN_PATH_PROPERTY]}/python3", | ||
'setup.py', | ||
'bdist_wheel', | ||
"--dist-dir=${project.buildDir}/dist" | ||
} | ||
|
||
task localInstallPythonPackage(type:Exec) { | ||
workingDir "${project.buildDir}/dist" | ||
|
||
commandLine "${project.properties[PYTHON_BIN_PATH_PROPERTY]}/pip", | ||
'install', | ||
'--no-index', | ||
'--find-links=./', | ||
'datalore-plot' | ||
} | ||
|
||
task publishPythonPackage(type:Exec) { | ||
workingDir "${project.buildDir}/dist" | ||
|
||
if (project.properties[PYTHON_REPOSITORY_URL_PROPERTY] != null) { | ||
commandLine "${project.properties[PYTHON_BIN_PATH_PROPERTY]}/twine", | ||
"upload", | ||
"--repository-url", | ||
project.properties[PYTHON_REPOSITORY_URL_PROPERTY], | ||
"-u", | ||
project.properties["pypi_username"], | ||
"-p", | ||
project.properties["pypi_password"], | ||
"./*" | ||
} else { | ||
commandLine "${project.properties[PYTHON_BIN_PATH_PROPERTY]}/twine", | ||
"upload", | ||
"-u", | ||
project.properties["pypi_username"], | ||
"-p", | ||
project.properties["pypi_password"], | ||
"./*" | ||
} | ||
} | ||
|
||
updateJs.dependsOn(':js-package:build') | ||
|
||
buildPythonPackage.dependsOn(':python-extension:build') | ||
|
||
buildPythonPackage.dependsOn(updateJs) | ||
|
||
build.dependsOn(buildPythonPackage) | ||
|
||
localInstallPythonPackage.dependsOn(buildPythonPackage) | ||
//publishPythonPackage.dependsOn(buildPythonPackage) | ||
|
||
|
||
} else { | ||
println("------------------------------------------------------------------------------------------------") | ||
println("Python package build unavailable. Please set \"python_bin\" property in gradle.properties file.") | ||
println("------------------------------------------------------------------------------------------------") | ||
} | ||
|
||
} else { | ||
println("------------------------------------------------------------------------------------------------") | ||
println("Python package build unavailable. Please set \"python_include_path\" property in gradle.properties file.") | ||
println("------------------------------------------------------------------------------------------------") | ||
} |
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,6 +1,3 @@ | ||
[metadata] | ||
# description-file = README.md | ||
license_file = ../LICENSE | ||
|
||
[bdist_wheel] | ||
universal = 1 |
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