Skip to content

Commit 1c78670

Browse files
committed
Merge branch 'release/2.16.0'
2 parents 9b91c91 + 99463d4 commit 1c78670

File tree

9 files changed

+42
-12
lines changed

9 files changed

+42
-12
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# force CRLF line endings for dos test file
2+
tests/stl_tests/dos.stl text eol=crlf
3+

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
dist: xenial
2-
sudo: false
32
language: python
43

54
env:
@@ -20,6 +19,9 @@ matrix:
2019
env: TOXENV=py37
2120
- python: '3.8'
2221
env: TOXENV=py38
22+
# before_install:
23+
# - sudo apt update
24+
# - sudo apt install -y xcb xvfb libxcb-xinerama0
2325
- python: '3.9'
2426
env: TOXENV=py39
2527
# Added power support architecture
@@ -70,11 +72,11 @@ notifications:
7072
on_failure: change
7173

7274
deploy:
75+
distributions: bdist_wheel
7376
provider: pypi
7477
user: WoLpH
7578
password:
7679
secure: HVxDUJ6ns7G7xypuibu01ruDfO4orV5lNr1Mor003MX3HVivvKsTwWqY5K1J+J+C4mgK6ahyvanD5GahYvcWia/Y2xeH2VnytnAgo+W3AI+h72+1oaRpvQHynJ7Fz6Mc0zad0GcbQh3QuA7Pu3IOWs7buUL+MQM6d9QLTkerOvs=
7780
on:
7881
tags: true
79-
distributions: bdist_wheel
8082
repo: WoLpH/numpy-stl

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def run(self):
108108
url=about['__url__'],
109109
license='BSD',
110110
packages=['stl'],
111+
package_data={about['__import_name__']: ['py.typed']},
111112
long_description=long_description,
112113
tests_require=tests_require,
113114
entry_points={

stl/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
__package_name__ = 'numpy-stl'
22
__import_name__ = 'stl'
3-
__version__ = '2.15.1'
3+
__version__ = '2.16.0'
44
__author__ = 'Rick van Hattem'
55
__author_email__ = '[email protected]'
66
__description__ = ' '.join('''

stl/_speedups.pyx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ def ascii_read(fh, buf):
107107
cdef locale_t new_locale = newlocale(LC_NUMERIC_MASK, 'C',
108108
<locale_t>NULL)
109109
cdef locale_t old_locale = uselocale(new_locale)
110-
freelocale(new_locale)
111110

112111
try:
113112
state.size = len(buf)
@@ -167,9 +166,9 @@ def ascii_read(fh, buf):
167166
fclose(state.fp)
168167
fh.seek(pos, SEEK_SET)
169168

170-
IF UNAME_SYSNAME == 'Linux':
171-
uselocale(old_locale)
172-
freelocale(old_locale)
169+
IF UNAME_SYSNAME == 'Linux':
170+
uselocale(old_locale)
171+
freelocale(new_locale)
173172

174173

175174
def ascii_write(fh, name, np.ndarray[Facet, mode = 'c', cast=True] arr):

stl/base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,15 @@ def rotate(self, axis, theta=0, point=None):
491491
self.rotate_using_matrix(self.rotation_matrix(axis, theta), point)
492492

493493
def rotate_using_matrix(self, rotation_matrix, point=None):
494+
'''
495+
Rotate using a given rotation matrix and optional rotation point
496+
497+
Note that this rotation produces clockwise rotations for positive
498+
angles which is arguably incorrect but will remain for legacy reasons.
499+
For more details, read here:
500+
https://github.com/WoLpH/numpy-stl/issues/166
501+
'''
502+
494503
identity = numpy.identity(rotation_matrix.shape[0])
495504
# No need to rotate if there is no actual rotation
496505
if not rotation_matrix.any() or (identity == rotation_matrix).all():

stl/py.typed

Whitespace-only changes.

tests/test_ascii.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import sys
3+
import locale
34
import pytest
45
import pathlib
56
import warnings
@@ -97,6 +98,21 @@ def test_scientific_notation(tmpdir, speedups):
9798
assert test_mesh.name == b(name)
9899

99100

101+
@pytest.mark.skipif(sys.platform.startswith('win'),
102+
reason='Only makes sense on Unix')
103+
def test_locale_restore(speedups):
104+
if not speedups:
105+
pytest.skip('Only makes sense with speedups')
106+
107+
old_locale = locale.nl_langinfo(locale.CODESET)
108+
109+
filename = FILES_PATH / 'bwb.stl'
110+
mesh.Mesh.from_file(filename, speedups=speedups)
111+
112+
new_locale = locale.nl_langinfo(locale.CODESET)
113+
assert old_locale == new_locale
114+
115+
100116
@pytest.mark.skipif(sys.platform.startswith('win'),
101117
reason='Only makes sense on Unix')
102118
def test_use_with_qt_with_custom_locale_decimal_delimeter(speedups):

tox.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ commands=
2727
sphinx-build -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
2828
# sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
2929

30-
[testenv:py36]
31-
# one optional test has PyQt5 dep, only test that once
32-
deps =
33-
-rtests/requirements.txt
34-
PyQt5
30+
# [testenv:py38]
31+
# # one optional test has PyQt5 dep, only test that once
32+
# deps =
33+
# -rtests/requirements.txt
34+
# PyQt5

0 commit comments

Comments
 (0)