Skip to content

Commit

Permalink
Merge pull request #191 from Esri/develop
Browse files Browse the repository at this point in the history
Release 1.7
  • Loading branch information
mistafunk authored Jun 29, 2023
2 parents 19a6255 + cac0604 commit 9385141
Show file tree
Hide file tree
Showing 76 changed files with 752 additions and 123 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# PyPRT ChangeLog

## v1.7.0 (2023-06-12)

### Added
* Added support for Rule Packages (RPK) created with CityEngine 2023.0
* Added support for textured initial shapes (also added the `maxDirRecursionDepth` argument to
the `InitialShape` class constructor to control searching for texture files).
* Added new API function `get_api_version` to get a list of the PRT (major, minor, build) components.

### Changed
* Updated to PRT 3.0.8905
* Updated to PyBind11 2.10.4
* Turned the `prt_DIR` and `pybind11_DIR` into proper CMake cache variables.

## v1.6.0 (2022-12-21)

### Added
Expand Down
47 changes: 38 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
import com.esri.zrh.jenkins.PipelineSupportLibrary
import com.esri.zrh.jenkins.JenkinsTools
import com.esri.zrh.jenkins.ce.CityEnginePipelineLibrary
import com.esri.zrh.jenkins.ce.PrtAppPipelineLibrary
import com.esri.zrh.jenkins.ce.PrtAppPipelineLibrary as PAPL
import com.esri.zrh.jenkins.PslFactory
import com.esri.zrh.jenkins.psl.UploadTrackingPsl
import groovy.transform.Field

@Field def psl = PslFactory.create(this, UploadTrackingPsl.ID)
@Field def cepl = new CityEnginePipelineLibrary(this, psl)
@Field def papl = new PrtAppPipelineLibrary(cepl)
@Field def papl = new PAPL(cepl)


// -- SETUP
Expand All @@ -37,7 +37,7 @@ env.PIPELINE_ARCHIVING_ALLOWED = "true"
@Field final String SOURCE_STASH = 'pyprt-sources'
@Field String pkgVer = "0.0.0"

@Field final String DOCKER_IMAGE_REV = "v6"
@Field final String DOCKER_IMAGE_REV = "v7"

@Field final String DOCKER_AGENT_LINUX = 'centos7-64-d'
@Field final String DOCKER_WS_LINUX = "/tmp/pyprt/ws"
Expand All @@ -56,6 +56,9 @@ env.PIPELINE_ARCHIVING_ALLOWED = "true"
@Field final Map LINUX_DOCKER_CONFIG = [ ba: DOCKER_AGENT_LINUX, ws: DOCKER_WS_LINUX ]
@Field final Map WINDOWS_DOCKER_CONFIG = [ ba: DOCKER_AGENT_WINDOWS, ws: DOCKER_WS_WINDOWS ]

@Field final Map PRT_DEFAULT = [ prt: 'Default' ] // as defined in the build system
@Field final Map PRT_LATEST = [ prt: 'Latest' ] // latest internal PRT build

@Field final List CONFIGS_PREPARE = [
composeConfig(PY38, KIND_WHEEL, LINUX_NATIVE_CONFIG, LINUX_DOCKER_CONFIG),
]
Expand All @@ -68,6 +71,8 @@ env.PIPELINE_ARCHIVING_ALLOWED = "true"
composeConfig(PY39, KIND_WHEEL, WINDOWS_NATIVE_CONFIG, WINDOWS_DOCKER_CONFIG),
composeConfig(PY310, KIND_WHEEL, LINUX_NATIVE_CONFIG, LINUX_DOCKER_CONFIG),
composeConfig(PY310, KIND_WHEEL, WINDOWS_NATIVE_CONFIG, WINDOWS_DOCKER_CONFIG),
composeConfig(PY310, KIND_WHEEL, LINUX_NATIVE_CONFIG, LINUX_DOCKER_CONFIG, PRT_LATEST),
composeConfig(PY310, KIND_WHEEL, WINDOWS_NATIVE_CONFIG, WINDOWS_DOCKER_CONFIG, PRT_LATEST),
]

@Field final List CONFIGS_BUILD_WHEEL = [
Expand All @@ -78,6 +83,8 @@ env.PIPELINE_ARCHIVING_ALLOWED = "true"
composeConfig(PY39, KIND_WHEEL, WINDOWS_NATIVE_CONFIG, WINDOWS_DOCKER_CONFIG),
composeConfig(PY310, KIND_WHEEL, LINUX_NATIVE_CONFIG, LINUX_DOCKER_CONFIG),
composeConfig(PY310, KIND_WHEEL, WINDOWS_NATIVE_CONFIG, WINDOWS_DOCKER_CONFIG),
composeConfig(PY310, KIND_WHEEL, LINUX_NATIVE_CONFIG, LINUX_DOCKER_CONFIG, PRT_LATEST),
composeConfig(PY310, KIND_WHEEL, WINDOWS_NATIVE_CONFIG, WINDOWS_DOCKER_CONFIG, PRT_LATEST),
]

@Field final List CONFIGS_BUILD_CONDA = [
Expand Down Expand Up @@ -153,7 +160,18 @@ def taskPrepare(cfg) {
}
}

dir(path: 'cesdk') {
dir(path: 'cesdk_latest') {
dir(path: 'windows') {
def myCfg = cfg + WINDOWS_NATIVE_CONFIG
papl.fetchDependency(PAPL.Dependencies.CESDK_LATEST, myCfg)
}
dir(path: 'linux') {
def myCfg = cfg + LINUX_NATIVE_CONFIG
papl.fetchDependency(PAPL.Dependencies.CESDK_LATEST, myCfg)
}
}

dir(path: 'cesdk_default') {
String CESDK_BASE_URL = 'https://github.com/Esri/cityengine-sdk/releases/download'
dir(path: 'windows') {
String CESDK_URL_WINDOWS = "${CESDK_BASE_URL}/${deps.PRT_VERSION}/esri_ce_sdk-${deps.PRT_VERSION}-${deps.PRT_CLS_WINDOWS}.zip"
Expand Down Expand Up @@ -190,8 +208,11 @@ def taskBuildWheel(cfg) {
runDockerCmd(cfg, dirMap, workDir, updateBuildEnv(cfg, workDir, buildCmd))

def classifierExtractor = { p ->
def cls = (p =~ /[^-]*-[^-]*-[0-9]*-([^-]*-[^-]*-[^-]*)\.whl/)
return cls[0][1]
def clsRegEx = (p =~ /[^-]*-[^-]*-[0-9]*-([^-]*-[^-]*-[^-]*)\.whl/)
String cls = clsRegEx[0][1]
if (cfg.prt == PRT_LATEST.prt)
cls += '-prtLatest'
return cls
}
papl.publish('pyprt', env.BRANCH_NAME, "PyPRT-*.whl", { return pkgVer }, cfg, classifierExtractor)
}
Expand Down Expand Up @@ -262,14 +283,22 @@ String updateBuildEnv(Map cfg, String workDir, String buildCmd) {
def deps = readProperties(file: "${SOURCE}/src/dependencies.properties")

String pybind11Env = "PYBIND11_DIR=${workDir}/src/pybind11-${deps.PYBIND11_VERSION}"
String cesdkEnv = "PRT_DIR=${cfg.ws}/cesdk/${isUnix() ? 'linux' : 'windows'}/cmake"

String os = isUnix() ? 'linux' : 'windows'
String cesdkDir = (cfg.prt == PRT_LATEST.prt) ? "cesdk_latest/${os}/ce_sdk" : "cesdk_default/${os}"
String cesdkEnv = "PRT_DIR=${cfg.ws}/${cesdkDir}/cmake"

String envCmd = isUnix() ? "export ${pybind11Env} ${cesdkEnv} " : "set ${pybind11Env}&& set ${cesdkEnv}"

return "${envCmd}&& ${buildCmd}"
}

@NonCPS
Map composeConfig(py, kind, tc, dc) {
return py + kind + tc + dc + [ grp: "py${py['py']}-${kind['kind']}" ]
Map composeConfig(py, kind, tc, dc, prt = PRT_DEFAULT) {
String label = "py${py['py']}-${kind['kind']}"
if (prt != PRT_DEFAULT)
label += "-prt${prt['prt']}"
return py + kind + tc + dc + prt + [ grp: label ]
}

String getDockerImage(Map cfg) {
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ _Note: on Windows, replace `bin` with `Scripts` in the following commands. Some
1. Install Miniconda or Anaconda.
1. Open a shell in the PyPRT git root and activate Miniconda (or Anaconda).
1. First time only: run `conda env create --prefix ./env --file envs/centos7/conda/environment-py3.8.yml` to create a conda environment with all the required Python packages (adapt `centos7` and `environment-py3.8.yml` to your desired OS/Python combination).
1. First time only: run `conda install --prefix ./env -c esri arcgis` (this is a workaround to reduce conda env resolving time)
1. Run `activate ./env`.
1. Run `python setup.py bdist_conda`. This will build the CMake project and Python packages. See [below](#c-debug-builds) for native debug mode.
1. The resulting package is written to the `./env/conda-bld/{platform}` folder.
Expand Down
2 changes: 1 addition & 1 deletion build_and_run_tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2022 Esri R&D Center Zurich
# Copyright (c) 2012-2023 Esri R&D Center Zurich

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
10 changes: 6 additions & 4 deletions envs/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ psl.runsHere('production')

@Field final String DOCKER_REGISTRY = 'zrh-dreg-sp-1.esri.com'
@Field final String DOCKER_PROJECT = "${DOCKER_REGISTRY}/pyprt/"
@Field final String DOCKER_IMAGE_REV = 'v6' // target revision of the generated images
@Field final String DOCKER_IMAGE_REV = 'v7' // target revision of the generated images

@Field final String REPO = '[email protected]:esri/pyprt.git'
@Field final String SOURCE = 'pyprt.git'
Expand Down Expand Up @@ -146,9 +146,11 @@ def taskBuildDockerImage(cfg) {

dir(path: SOURCE) {
docker.withRegistry("https://${DOCKER_REGISTRY}", 'jenkins-pyprt-dreg-robot') {
def dockerImage = docker.build(image, "-m 8GB --rm -f ${dockerFile} ${buildArgs} ${labelArgs} ${targetArgs} .")
dockerImage.push(tag)
psl.runCmd("docker image prune -a -f --filter label=${buildLabel}")
psl.runContainerBuild() {
def dockerImage = docker.build(image, "-m 8GB --rm -f ${dockerFile} ${buildArgs} ${labelArgs} ${targetArgs} .")
dockerImage.push(tag)
psl.runCmd("docker image prune -a -f --filter label=${buildLabel}")
}
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions envs/centos7/conda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ RUN mkdir /tmp/pyprt
WORKDIR /tmp/pyprt

# see https://github.com/conda/conda-docker/blob/master/miniconda3/centos7/Dockerfile
ADD --chown=${USER_ID}:${GROUP_ID} https://zrh-code.esri.com/nexus/service/local/repositories/tools/content/io/conda/miniconda3/4.10.3/miniconda3-4.10.3-py39-linux-x86_64.sh /tmp/pyprt/miniconda.sh
ADD --chown=${USER_ID}:${GROUP_ID} https://zrh-code.esri.com/nexus/service/local/repositories/tools/content/io/conda/miniconda3/22.11.1/miniconda3-22.11.1-py310-linux-x86_64.sh /tmp/pyprt/miniconda.sh
RUN bash miniconda.sh -bfp ./conda && \
rm -rf ./miniconda.sh && \
conda/bin/conda install -y python=${PY_VER} && \
conda/bin/conda update conda && \
conda/bin/conda clean --all --yes && \
conda/bin/conda config -v --system --set remote_backoff_factor 2 --set remote_connect_timeout_secs 60 --set remote_max_retries 8 --set remote_read_timeout_secs 240
Expand All @@ -33,4 +32,4 @@ RUN echo "unset BASH_ENV PROMPT_COMMAND ENV && source scl_source enable devtools
ENV BASH_ENV=/tmp/env_enable ENV=/tmp/env_enable PROMPT_COMMAND="source /tmp/env_enable"

FROM req_install AS arcgis_install
RUN ./conda/bin/conda install -c esri arcgis
RUN ./conda/bin/conda install --prefix ./pyprt-conda-env -c esri arcgis
2 changes: 1 addition & 1 deletion envs/centos7/wheel/requirements-py3.10.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pkginfo
Sphinx
Sphinx<7.0
twine
wheel
xmlrunner
5 changes: 3 additions & 2 deletions envs/centos7/wheel/requirements-py3.8.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
arcgis
urllib3<1.26.0
pkginfo
Shapely
Sphinx
Sphinx<7.0
twine
wheel
xmlrunner
numpy==1.21.6
numpy<1.24.0
5 changes: 3 additions & 2 deletions envs/centos7/wheel/requirements-py3.9.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
arcgis
urllib3<1.26.0
pkginfo
Shapely
Sphinx
Sphinx<7.0
twine
wheel
xmlrunner
numpy==1.21.6
numpy<1.24.0
4 changes: 2 additions & 2 deletions envs/windows/conda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG PY_VER
ARG BASE_TAG=''
FROM ${REGISTRY}pyprt-base:${BASE_TAG} AS req_install

ADD https://zrh-code.esri.com/nexus/service/local/repositories/tools/content/io/conda/miniconda3/4.10.3/miniconda3-4.10.3-py39-windows-x86_64.exe C:\temp\miniconda.exe
ADD https://zrh-code.esri.com/nexus/service/local/repositories/tools/content/io/conda/miniconda3/22.11.1/miniconda3-22.11.1-py310-windows-x86_64.exe C:\temp\miniconda.exe
RUN C:\temp\miniconda.exe /S /AddToPath=1 /InstallationType=JustMe /RegisterPython=0 /D=C:\temp\conda

WORKDIR C:\temp\pyprt
Expand All @@ -22,4 +22,4 @@ RUN conda env create -vv -n pyprt --file environment.yml
ENTRYPOINT [ "C:\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat", "x64", "-vcvars_ver=14.27", "&&", "call", "conda.bat", "activate", "pyprt", "&&" ]

FROM req_install AS arcgis_install
RUN conda install -c esri arcgis
RUN conda install -n pyprt -c esri arcgis
2 changes: 1 addition & 1 deletion envs/windows/wheel/requirements-py3.10.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pkginfo
Sphinx
Sphinx<7.0
twine
wheel
xmlrunner
Expand Down
4 changes: 3 additions & 1 deletion envs/windows/wheel/requirements-py3.7.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
arcgis
urllib3<1.26.0
pkginfo
Shapely
Sphinx
Sphinx<7.0
twine
wheel
xmlrunner
numpy<1.24.0
5 changes: 3 additions & 2 deletions envs/windows/wheel/requirements-py3.8.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
arcgis
urllib3<1.26.0
pkginfo
Shapely
Sphinx
Sphinx<7.0
twine
wheel
xmlrunner
numpy==1.21.6
numpy<1.24.0
5 changes: 3 additions & 2 deletions envs/windows/wheel/requirements-py3.9.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
arcgis
urllib3<1.26.0
pkginfo
Shapely
Sphinx
Sphinx<7.0
twine
wheel
xmlrunner
numpy==1.21.6
numpy<1.24.0
2 changes: 1 addition & 1 deletion example.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2022 Esri R&D Center Zurich
# Copyright (c) 2012-2023 Esri R&D Center Zurich

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions pyprt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2022 Esri R&D Center Zurich
# Copyright (c) 2012-2023 Esri R&D Center Zurich

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,6 +13,6 @@
# limitations under the License.
# A copy of the license is available in the repository's LICENSE file.

__version__ = '1.6.0'
__version__ = '1.7.0'

from .pyprt import *
2 changes: 1 addition & 1 deletion pyprt/pyprt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2022 Esri R&D Center Zurich
# Copyright (c) 2012-2023 Esri R&D Center Zurich

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion pyprt/pyprt_arcgis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2022 Esri R&D Center Zurich
# Copyright (c) 2012-2023 Esri R&D Center Zurich

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion pyprt/pyprt_arcgis/pyprt_arcgis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2022 Esri R&D Center Zurich
# Copyright (c) 2012-2023 Esri R&D Center Zurich

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion pyprt/pyprt_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2022 Esri R&D Center Zurich
# Copyright (c) 2012-2023 Esri R&D Center Zurich

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion pyprt/pyprt_utils/pyprt_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2022 Esri R&D Center Zurich
# Copyright (c) 2012-2023 Esri R&D Center Zurich

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2022 Esri R&D Center Zurich
# Copyright (c) 2012-2023 Esri R&D Center Zurich

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -38,8 +38,8 @@

pyprt_name = 'PyPRT'
pyprt_author = 'Esri R&D Center Zurich'
pyprt_copyright = '(c) 2022, ' + pyprt_author
pyprt_version = '1.6.0' # keep consistent with __version__ in pyprt/__init__.py
pyprt_copyright = '(c) 2023, ' + pyprt_author
pyprt_version = '1.7.0' # keep consistent with __version__ in pyprt/__init__.py

record_file = os.path.join(os.path.realpath(os.curdir), pyprt_name + '.egg-info', 'record_setup_develop_files.txt')

Expand Down Expand Up @@ -162,11 +162,11 @@ def build_extension(self, extension):

prt_dir = os.getenv('PRT_DIR', '')
if prt_dir != '':
cmake_configure_command.append('-Dprt_DIR={}'.format(prt_dir))
cmake_configure_command.append('-Dprt_DIR:FILEPATH={}'.format(prt_dir))

pybind11_dir = os.getenv('PYBIND11_DIR', '')
if pybind11_dir != '':
cmake_configure_command.append('-Dpybind11_DIR={}'.format(pybind11_dir))
cmake_configure_command.append('-Dpybind11_DIR:FILEPATH={}'.format(pybind11_dir))

self.spawn(cmake_configure_command)

Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# PyPRT - Python Bindings for the Procedural Runtime (PRT) of CityEngine
#
# Copyright (c) 2012-2022 Esri R&D Center Zurich
# Copyright (c) 2012-2023 Esri R&D Center Zurich
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 9385141

Please sign in to comment.