Skip to content

Commit 4069392

Browse files
author
andrewliew
committed
Merge remote-tracking branch 'origin/master'
2 parents 71fe493 + 6ce0fe0 commit 4069392

File tree

8 files changed

+169
-59
lines changed

8 files changed

+169
-59
lines changed

.bumpversion.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ search = __version__ = '{current_version}'
2929
replace = __version__ = '{new_version}'
3030

3131
[bumpversion:file:CHANGELOG.md]
32-
search = [Unreleased]
33-
replace = {new_version}
32+
search = Unreleased
33+
replace = [{new_version}] {now:%Y-%m-%d}
3434

CHANGELOG.md

Lines changed: 78 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,102 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12-
- Support for relative mesh references in URDF.
12+
### Changed
13+
14+
- Fix exception on Rhino Mac.
15+
- Fix missing import on `compas_rhino.geometry`.
16+
17+
### Removed
18+
19+
## [0.5.0] 2019-03-15
20+
21+
### Added
22+
23+
- Add `Circle` and `Sphere` primitives to `compas.geometry`.
24+
- Add functions to `Plane` and `Box` primitives.
25+
- Add functions to `compas_rhino` curve: `length` and `is_closed`.
26+
- Add functions to `compas_rhino` surface: `kinks`, `closest_point`, `closest_point_on_boundaries`, and functions for mapping/remapping between XYZ and UV(0) spaces based on surface's parametrization (`point_xyz_to_uv`, `point_uv_to_xyz`, `line_uv_to_xyz`, `polyline_uv_to_xyz`, `mesh_uv_to_xyz`)
27+
- Add `is_scalable` to `compas.robots.Joint`.
28+
29+
### Changed
1330

14-
## 0.5.0
31+
- Fix exception in `Plane.transform`.
32+
- Fix installer to remove old symlinks.
33+
- Fix RPC proxy server.
34+
35+
## [0.4.22] 2019-03-05
1536

1637
### Added
1738

39+
- Add pretty print option to JSON formatter.
40+
- Add remeshing based on `triangle`.
41+
- Add compatibility with ETO forms to `compas_rhino` edge modifiers.
42+
43+
## [0.4.21] 2019-03-04
44+
45+
### Changed
46+
47+
- Fix import in `compas_rhino` vertex modifiers.
48+
49+
## [0.4.20] 2019-03-04
50+
51+
### Removed
52+
53+
- Remove `download_image_from_remote` utility function.
54+
55+
## [0.4.12] 2019-03-04
56+
57+
### Changed
58+
59+
- Small fixes on Rhino forms support.
60+
61+
## [0.4.11] 2019-03-03
62+
63+
### Added
64+
65+
- New function to join network edges into polylines: `network_polylines`.
66+
- New mesh functions: `mesh_offset`, `mesh_thicken`, `mesh_weld` and `meshes_join_and_weld`.
67+
- New mesh functions: `face_skewness`, `face_aspect_ratio`, `face_curvature` and `vertex_curvature`.
68+
- New functions to get disconnected elements of `Mesh`: `mesh_disconnected_vertices`, `mesh_disconnected_faces`, `mesh_explode`.
69+
- New functions to get disconnected elements of `Network`: `network_disconnected_vertices`, `network_disconnected_edges`, `network_explode`.
70+
- Add statistics utility functions: `average`, `variance`, `standard_deviation`.
71+
- Add `binomial_coefficient` function.
72+
- Add option to create `Network` and `Mesh` from dictionaries of vertices and faces.
73+
- Add `face_adjacency_vertices` to `Mesh`
74+
- Add optional prefix to the rhino name attribute processor
75+
- Add `mesh_move_vertices` to `compas_rhino`.
76+
- Add support for relative mesh references in URDF.
77+
78+
### Changed
79+
80+
- Fix mesh centroid and mesh normal calculation.
81+
- Refactor of drawing functions in `compas_blender`.
82+
- Fix material creation in `compas_blender`.
83+
- New default for subdivision: `catmullclark`.
84+
85+
## [0.4.9] 2019-02-10
86+
87+
### Added
88+
89+
- New class methods for `Polyhedron`: `from_platonicsolid` and `from_vertices_and_faces`.
1890
- Constrained and conforming Delaunay triangulations based on Triangle.
1991
- Predicate-based filtering of vertices and edges.
2092

2193
### Changed
2294

23-
- Updated Rhino installation merging Win32 and Mac implementations and defaulting the bootstrapper to the active python even if no CONDA environment is active during install.
95+
- Fix exception in `angle_vectors_signed` if vectors aligned
96+
- Fix exception in `Polyline.point`
97+
- Update Rhino installation merging Win32 and Mac implementations and defaulting the bootstrapper to the active python even if no CONDA environment is active during install.
2498

2599
### Removed
26100

27101
- Bound mesh operations.
28102

29-
## [0.4.8] - 2019-01-28
103+
## [0.4.8] 2019-01-28
30104

31105
### Added
32106

33107
- Curve tangent at parameter.
34108
- Box shape.
35109
- Numpy-based mesh transformations.
36110
- Option to share axes among plotters.
37-
38-
### Changed
39-
40-
### Removed
41-

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ If you find a bug, please help us solve it by [filing a report](https://github.c
6161
If you want to contribute, check out the [contribution guidelines](https://compas-dev.github.io/main/contributions.html).
6262

6363

64+
## Changelog
65+
66+
See changes between releases on the [changelog](https://compas-dev.github.io/main/changelog.html).
67+
68+
6469
## License
6570

6671
The main library of **COMPAS** is [released under the MIT license](https://compas-dev.github.io/main/license.html).

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. mdinclude:: ../CHANGELOG.md

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
'sphinx.ext.mathjax',
4343
'sphinx.ext.napoleon',
4444
'matplotlib.sphinxext.plot_directive',
45+
'm2r',
4546
]
4647

4748
# autodoc options

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ The main library of COMPAS
1313
tutorials
1414
api
1515
contributions
16+
changelog
1617
citing
1718
license

requirements-dev.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
sphinx>=1.6
2-
sphinx_compas_theme>=0.1.10
3-
ipython>=5.8
4-
invoke>=0.14
51
bumpversion>=0.5
62
check-manifest>=0.36
73
flake8
8-
pytest==3.2
4+
invoke>=0.14
5+
ipython>=5.8
96
isort
7+
m2r
8+
pytest==3.2
9+
sphinx_compas_theme>=0.1.10
10+
sphinx>=1.6
1011
twine
1112
-e .

tasks.py

Lines changed: 75 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -69,39 +69,36 @@ def help(ctx):
6969
'builds': 'True to clean up build/packaging artifacts, otherwise False.'})
7070
def clean(ctx, docs=True, bytecode=True, builds=True):
7171
"""Cleans the local copy from compiled artifacts."""
72-
if builds:
73-
ctx.run('python setup.py clean')
7472

75-
if bytecode:
76-
# for root, dirs, files in os.walk(BASE_FOLDER):
77-
# for f in files:
78-
# if f.endswith('.pyc'):
79-
# os.remove(os.path.join(root, f))
80-
# if '.git' in dirs:
81-
# dirs.remove('.git')
82-
files = glob.glob('src/**/*.pyc', recursive=True)
83-
for path in files:
84-
try:
85-
os.remove(file)
86-
except Exception:
87-
pass
73+
with chdir(BASE_FOLDER):
74+
if builds:
75+
ctx.run('python setup.py clean')
8876

89-
folders = []
77+
if bytecode:
78+
for root, dirs, files in os.walk(BASE_FOLDER):
79+
for f in files:
80+
if f.endswith('.pyc'):
81+
os.remove(os.path.join(root, f))
82+
if '.git' in dirs:
83+
dirs.remove('.git')
9084

91-
if docs:
92-
folders.append('docs/api/generated')
85+
folders = []
9386

94-
folders.append('dist/')
87+
if docs:
88+
folders.append('docs/api/generated')
9589

96-
if bytecode:
97-
folders.extend(glob.glob('src/**/__pycache__', recursive=True))
90+
folders.append('dist/')
9891

99-
if builds:
100-
folders.append('build/')
101-
folders.append('src/compas.egg-info/')
92+
if bytecode:
93+
for t in ('src', 'tests'):
94+
folders.extend(glob.glob('{}/**/__pycache__'.format(t), recursive=True))
10295

103-
for folder in folders:
104-
rmtree(os.path.join(BASE_FOLDER, folder), ignore_errors=True)
96+
if builds:
97+
folders.append('build/')
98+
folders.append('src/compas.egg-info/')
99+
100+
for folder in folders:
101+
rmtree(os.path.join(BASE_FOLDER, folder), ignore_errors=True)
105102

106103

107104
@task(help={
@@ -110,32 +107,36 @@ def clean(ctx, docs=True, bytecode=True, builds=True):
110107
'check_links': 'True to check all web links in docs for validity, otherwise False.'})
111108
def docs(ctx, doctest=False, rebuild=True, check_links=False):
112109
"""Builds package's HTML documentation."""
110+
113111
if rebuild:
114112
clean(ctx)
115113

116-
if doctest:
117-
ctx.run('sphinx-build -E -b doctest docs dist/docs')
114+
with chdir(BASE_FOLDER):
115+
if doctest:
116+
ctx.run('sphinx-build -E -b doctest docs dist/docs')
118117

119-
ctx.run('sphinx-build -E -b html docs dist/docs')
118+
ctx.run('sphinx-build -E -b html docs dist/docs')
120119

121-
if check_links:
122-
ctx.run('sphinx-build -E -b linkcheck docs dist/docs')
120+
if check_links:
121+
ctx.run('sphinx-build -E -b linkcheck docs dist/docs')
123122

124123

125124
@task()
126125
def check(ctx):
127126
"""Check the consistency of documentation, coding style and a few other things."""
128-
log.write('Checking MANIFEST.in...')
129-
ctx.run('check-manifest --ignore-bad-ideas=test.so,fd.so,smoothing.so,drx_c.so')
130127

131-
log.write('Checking metadata...')
132-
ctx.run('python setup.py check --strict --metadata')
128+
with chdir(BASE_FOLDER):
129+
log.write('Checking MANIFEST.in...')
130+
ctx.run('check-manifest --ignore-bad-ideas=test.so,fd.so,smoothing.so,drx_c.so')
131+
132+
log.write('Checking metadata...')
133+
ctx.run('python setup.py check --strict --metadata')
133134

134-
# log.write('Running flake8 python linter...')
135-
# ctx.run('flake8 src tests setup.py')
135+
# log.write('Running flake8 python linter...')
136+
# ctx.run('flake8 src tests setup.py')
136137

137-
# log.write('Checking python imports...')
138-
# ctx.run('isort --check-only --diff --recursive src tests setup.py')
138+
# log.write('Checking python imports...')
139+
# ctx.run('isort --check-only --diff --recursive src tests setup.py')
139140

140141

141142
@task(help={
@@ -145,11 +146,29 @@ def test(ctx, checks=False, doctest=False):
145146
if checks:
146147
check(ctx)
147148

148-
cmd = ['pytest']
149-
if doctest:
150-
cmd.append('--doctest-modules')
149+
with chdir(BASE_FOLDER):
150+
cmd = ['pytest']
151+
if doctest:
152+
cmd.append('--doctest-modules')
153+
154+
ctx.run(' '.join(cmd))
155+
156+
157+
@task
158+
def prepare_changelog(ctx):
159+
"""Prepare changelog for next release."""
160+
UNRELEASED_CHANGELOG_TEMPLATE = '## Unreleased\n\n### Added\n\n### Changed\n\n### Removed\n\n\n## '
161+
162+
with chdir(BASE_FOLDER):
163+
# Preparing changelog for next release
164+
with open('CHANGELOG.md', 'r+') as changelog:
165+
content = changelog.read()
166+
changelog.seek(0)
167+
changelog.write(content.replace(
168+
'## ', UNRELEASED_CHANGELOG_TEMPLATE, 1))
169+
170+
ctx.run('git add CHANGELOG.md && git commit -m "Prepare changelog for next release"')
151171

152-
ctx.run(' '.join(cmd))
153172

154173

155174
@task(help={
@@ -175,7 +194,20 @@ def release(ctx, release_type):
175194

176195
if len(dist_files):
177196
ctx.run('twine upload --skip-existing %s' % dist_files)
197+
198+
prepare_changelog(ctx)
178199
else:
179200
raise Exit('No files found to release')
180201
else:
181202
raise Exit('Aborted release')
203+
204+
205+
@contextlib.contextmanager
206+
def chdir(dirname=None):
207+
current_dir = os.getcwd()
208+
try:
209+
if dirname is not None:
210+
os.chdir(dirname)
211+
yield
212+
finally:
213+
os.chdir(current_dir)

0 commit comments

Comments
 (0)