Skip to content

Commit cf20af6

Browse files
authored
version bump to 0.8.0 (#1162)
* 0.8.0 version bump and logistics changes * simplify doc * python 2, 3 compatible import
1 parent e1eceab commit cf20af6

File tree

11 files changed

+73
-125
lines changed

11 files changed

+73
-125
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ string(CONCAT PROJECT_VERSION_THREE_NUMBER "${OPEN3D_VERSION_MAJOR}"
3232
".${OPEN3D_VERSION_MINOR}"
3333
".${OPEN3D_VERSION_PATCH}")
3434

35-
# pypi package name controls specifies the repository name on pypi
36-
# possbie names include:
37-
# - open3d: default name when building from source and for conda
38-
# - open3d-python: for PyPI
35+
# PyPI package name controls specifies the repository name on PyPI. The default
36+
# name is "open3d". In the past, for historical reasons, we've used the
37+
# following names for PyPI, while they are now deprecated:
38+
# - open3d-python
3939
# - py3d
4040
# - open3d-original
4141
# - open3d-official

docs/compilation.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,11 @@ Alternatively, this file can be generated by calling CMake from the console:
285285
286286
mkdir build
287287
cd build
288+
289+
:: Run one of the following lines based on your Visual Studio version
288290
cmake -G "Visual Studio 14 2015 Win64" ..
291+
cmake -G "Visual Studio 15 2017 Win64" ..
292+
cmake -G "Visual Studio 16 2019 Win64" ..
289293
290294
.. error:: If cmake fail to find ``PYTHON_EXECUTABLE``, follow the Ubuntu guide:
291295
:ref:`compilation_ubuntu_python_binding` to activate the Python virtualenv before running

docs/conf.py

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ def get_git_short_hash():
3232
return rc
3333

3434

35-
def get_git_tag_short_hash(tag):
36-
_ = subprocess.check_output(['git', 'fetch', '--tags'])
37-
tags = subprocess.check_output(['git', 'show-ref', '--hash=8', tag])
38-
tags = tags.decode("utf-8").strip()
39-
tag = tags.split('\n')[0]
40-
return tag
41-
42-
4335
# Import open3d raw python package with the highest priority
4436
# This is a trick to show open3d.open3d as open3d in the docs
4537
# Only tested to work on Unix
@@ -84,29 +76,11 @@ def get_git_tag_short_hash(tag):
8476
# |version| and |release|, also used in various other places throughout the
8577
# built documents.
8678

87-
# When building docs for a release e.g. 0.8.0, version == "v0.8.0"
88-
# When building docs for master, version == "latest (git_SHA_hash)"
89-
version_list = [
90-
line.rstrip('\n').split(' ')[1]
91-
for line in open('../src/Open3D/version.txt')
92-
]
93-
94-
last_release = '.'.join(version_list[:3])
95-
last_release_tag = 'v' + last_release
79+
# This value can be overwritten in make_docs.py when sphinx-build is called.
80+
# Usually, the `version` value is set to the current git commit hash.
81+
# At Open3D releases, the `version` value is set to Open3D version number.
9682
current_hash = get_git_short_hash()
97-
last_release_hash = get_git_tag_short_hash(last_release_tag)
98-
99-
if current_hash == last_release_hash:
100-
# The last_release is current commit
101-
# Building docs for a release, use version directly
102-
version = last_release
103-
else:
104-
# Building docs for master branch (latest), include hash
105-
version = "latest ({})".format(current_hash)
106-
107-
print("Building docs for version:", version)
108-
109-
# The full version, including alpha/beta/rc tags.
83+
version = "latest ({})".format(current_hash)
11084
release = version
11185

11286
# The language for content autogenerated by Sphinx. Refer to documentation

docs/getting_started.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Installing from PyPI or Conda
99
=============================
1010

1111
Open3D Python packages are distributed via
12-
`PyPI <https://pypi.org/project/open3d-python/>`_ and
12+
`PyPI <https://pypi.org/project/open3d/>`_ and
1313
`Conda <https://anaconda.org/open3d-admin/open3d>`_.
1414

1515
Supported Python versions:
@@ -29,7 +29,7 @@ PyPI
2929

3030
.. code-block:: bash
3131
32-
pip install open3d-python
32+
pip install open3d
3333
3434
Note: In general, we recommend using a
3535
`virtual environment <https://docs.python-guide.org/dev/virtualenvs/>`_ for
@@ -39,11 +39,11 @@ permission issues. For example:
3939

4040
.. code-block:: bash
4141
42-
pip3 install open3d-python
42+
pip3 install open3d
4343
# or
44-
pip install --user open3d-python
44+
pip install --user open3d
4545
# or
46-
python3 -m pip install --user open3d-python
46+
python3 -m pip install --user open3d
4747
4848
Conda
4949
-----

docs/make_docs.py

Lines changed: 35 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -51,71 +51,6 @@ def _create_or_clear_dir(dir_path):
5151
print("Created directory %s" % dir_path)
5252

5353

54-
class TemporaryDirectory(object):
55-
"""
56-
Porting Python 3's TemporaryDirectory context manager to Python 2
57-
https://github.com/python/cpython/blob/master/Lib/tempfile.py
58-
"""
59-
60-
def __init__(self, suffix=None, prefix=None, dir=None):
61-
self.name = mkdtemp(suffix, prefix, dir)
62-
self._finalizer = weakref.finalize(
63-
self,
64-
self._cleanup,
65-
self.name,
66-
warn_message="Implicitly cleaning up {!r}".format(self))
67-
68-
@classmethod
69-
def _rmtree(cls, name):
70-
71-
def onerror(func, path, exc_info):
72-
if issubclass(exc_info[0], PermissionError):
73-
74-
def resetperms(path):
75-
try:
76-
os.chflags(path, 0)
77-
except AttributeError:
78-
pass
79-
os.chmod(path, 0o700)
80-
81-
try:
82-
if path != name:
83-
resetperms(os.path.dirname(path))
84-
resetperms(path)
85-
86-
try:
87-
os.unlink(path)
88-
# PermissionError is raised on FreeBSD for directories
89-
except (IsADirectoryError, PermissionError):
90-
cls._rmtree(path)
91-
except FileNotFoundError:
92-
pass
93-
elif issubclass(exc_info[0], FileNotFoundError):
94-
pass
95-
else:
96-
raise ()
97-
98-
shutil.rmtree(name, onerror=onerror)
99-
100-
@classmethod
101-
def _cleanup(cls, name, warn_message):
102-
cls._rmtree(name)
103-
warnings.warn(warn_message, ResourceWarning)
104-
105-
def __repr__(self):
106-
return "<{} {!r}>".format(self.__class__.__name__, self.name)
107-
108-
def __enter__(self):
109-
return self.name
110-
111-
def __exit__(self, exc, value, tb):
112-
self.cleanup()
113-
114-
def cleanup(self):
115-
if self._finalizer.detach():
116-
self._rmtree(self.name)
117-
118-
11954
class PyAPIDocsBuilder:
12055
"""
12156
Generate Python API *.rst files, per (sub) module, per class, per function.
@@ -263,8 +198,7 @@ class SphinxDocsBuilder:
263198
(3) Calls `sphinx-build` with the user argument
264199
"""
265200

266-
def __init__(self, html_output_dir):
267-
# Hard-coded parameters for Python API docs generation for now
201+
def __init__(self, html_output_dir, is_release):
268202
# Directory structure for the Open3D Python package:
269203
# open3d
270204
# - __init__.py
@@ -273,6 +207,7 @@ def __init__(self, html_output_dir):
273207
self.c_module_relative = "open3d" # The relative module reference to open3d.so
274208
self.python_api_output_dir = "python_api"
275209
self.html_output_dir = html_output_dir
210+
self.is_release = is_release
276211

277212
def run(self):
278213
self._gen_python_api_docs()
@@ -293,20 +228,41 @@ def _run_sphinx(self):
293228
"""
294229
Call Sphinx command with hard-coded "html" target
295230
"""
296-
with TemporaryDirectory() as build_dir:
231+
build_dir = os.path.join(self.html_output_dir, "html")
232+
233+
if self.is_release:
234+
version_list = [
235+
line.rstrip('\n').split(' ')[1]
236+
for line in open('../src/Open3D/version.txt')
237+
]
238+
release_version = '.'.join(version_list[:3])
239+
print("Building docs for release:", release_version)
240+
297241
cmd = [
298242
"sphinx-build",
299-
"-M",
243+
"-b",
300244
"html",
245+
"-D",
246+
"version=" + release_version,
247+
"-D",
248+
"release=" + release_version,
249+
"-j",
250+
str(multiprocessing.cpu_count()),
301251
".",
302252
build_dir,
253+
]
254+
else:
255+
cmd = [
256+
"sphinx-build",
257+
"-b",
258+
"html",
303259
"-j",
304260
str(multiprocessing.cpu_count()),
261+
".",
262+
build_dir,
305263
]
306-
print('Calling: "%s"' % " ".join(cmd))
307-
subprocess.check_call(cmd, stdout=sys.stdout, stderr=sys.stderr)
308-
shutil.copytree(os.path.join(build_dir, "html"),
309-
os.path.join(self.html_output_dir, "html"))
264+
print('Calling: "%s"' % " ".join(cmd))
265+
subprocess.check_call(cmd, stdout=sys.stdout, stderr=sys.stderr)
310266

311267

312268
class DoxygenDocsBuilder:
@@ -340,6 +296,11 @@ def run(self):
340296
action="store_true",
341297
default=False,
342298
help="Build Doxygen for C++ API docs.")
299+
parser.add_argument("--is_release",
300+
dest="is_release",
301+
action="store_true",
302+
default=False,
303+
help="Show Open3D version number rather than git hash.")
343304
args = parser.parse_args()
344305

345306
# Clear output dir if new docs are to be built
@@ -350,7 +311,7 @@ def run(self):
350311
# To customize build, run sphinx-build manually
351312
if args.build_sphinx:
352313
print("Sphinx build enabled")
353-
sdb = SphinxDocsBuilder(html_output_dir)
314+
sdb = SphinxDocsBuilder(html_output_dir, args.is_release)
354315
sdb.run()
355316
else:
356317
print("Sphinx build disabled, use --sphinx to enable")

examples/Python/Basic/mesh_properties.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,8 @@ def fmt_bool(b):
9494
if not edge_manifold:
9595
print(' # Remove non-manifold edges')
9696
mesh.remove_non_manifold_edges()
97-
print(
98-
f' # Is mesh now edge-manifold: {fmt_bool(mesh.is_edge_manifold())}'
99-
)
97+
print(' # Is mesh now edge-manifold: {}'.format(
98+
fmt_bool(mesh.is_edge_manifold())))
10099
o3d.visualization.draw_geometries([mesh])
101100

102101

src/Open3D/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
OPEN3D_VERSION_MAJOR 0
2-
OPEN3D_VERSION_MINOR 7
2+
OPEN3D_VERSION_MINOR 8
33
OPEN3D_VERSION_PATCH 0
44
OPEN3D_VERSION_TWEAK 0

src/Python/package/README.rst

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
About This Project
44
#######################
55

6-
Open3D is an open-source library that supports rapid development of software that deals with 3D data. The Open3D frontend exposes a set of carefully selected data structures and algorithms in both C++ and Python. The backend is highly optimized and is set up for parallelization. We welcome contributions from the open-source community.
6+
Open3D is an open-source library that supports rapid development of software
7+
that deals with 3D data. The Open3D frontend exposes a set of carefully selected
8+
data structures and algorithms in both C++ and Python. The backend is highly
9+
optimized and is set up for parallelization. We welcome contributions from the
10+
open-source community.
711

812
If you use Open3D in an academic project, please cite our paper:
913
::
@@ -30,9 +34,15 @@ Supported platforms
3034

3135
The package has been tested on:
3236

33-
* Ubuntu 16.04 with Python 2.7 and 3.5
34-
* Windows 10 with Python 2.7 and 3.5
35-
* MacOS High Sierra 10.13.4 with Python 2.7
37+
* Ubuntu 16.04, Ubuntu 18.04
38+
* Windows 10 64-bit
39+
* macOS High Sierra and above
40+
41+
With Python version:
42+
* 2.7
43+
* 3.5
44+
* 3.6
45+
* 3.7
3646

3747
Resources
3848
======================

src/Python/package/conda_meta/meta.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# Currently this meta file is created manaully. We can also generate this meta
2-
# file with `conda skeleton pypi open3d-python`. The main difference is that
2+
# file with `conda skeleton pypi open3d`. The main difference is that
33
# the this manaully create meta.yaml uses the shared objects in the local
44
# `pip_package` folder, while the auto generated meta uses the PyPI source
5-
# distribution during Conda package creation. The manual meta file is chosen
6-
# since we'll use the `open3d` name rather than open3d-python`.
5+
# distribution during Conda package creation.
76

87
package:
98
name: open3d

src/Python/package/open3d/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
__version__ = '@PROJECT_VERSION@'
3838

3939
if "@ENABLE_JUPYTER@" == "ON":
40-
from open3d.j_visualizer import *
40+
from .j_visualizer import *
4141

4242
def _jupyter_nbextension_paths():
4343
return [{

0 commit comments

Comments
 (0)