wolph / numpy-stl

Simple library to make working with STL files (and 3D objects in general) fast and easy.
http://numpy-stl.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
605 stars 103 forks source link

Drop Python 2 and update mpl examples #204

Closed oscargus closed 1 year ago

oscargus commented 1 year ago

Six things (in the order I did them, one lead to another, sort of):

  1. Update the rest of the mpl-examples (Axes3D does no longer automatically add itself to a figure).
  2. Update supported versions based on the versions tested for
  3. Drop Python 2 support
  4. ~Test 3.9 and 3.10 on AppVeyor~ Doesn't work because of different str of temporary directory(?).
  5. Update checkout and setup-python versions for GitHub
  6. Cythonize on Windows as well.

~One should possibly also remove all instances of the s function, but not done.~

lgtm-com[bot] commented 1 year ago

This pull request introduces 1 alert when merging ea15d983b0aa63da7167885ca72c8805ac3f9b34 into dc999b2fc56b71e10608470db3998db39ed40aa3 - view on LGTM.com

new alerts:

oscargus commented 1 year ago

This is the error I get:

ascii_file = 'C:\\Users\\Oscar\\numpy-stl\\tests\\stl_ascii\\HalfDonut.stl', tmpdir = local('C:\\Users\\Oscar\\numpy-stl\\tests\\tmp\\test_args_False_0')

    def test_args(ascii_file, tmpdir):
        parser = main._get_parser('')

        def _get_name(*args):
            return main._get_name(parser.parse_args(list(map(str, args))))

        assert _get_name('--name', 'foobar') == 'foobar'
        assert _get_name('-', tmpdir.join('binary.stl')).endswith('binary.stl')
>       assert _get_name(ascii_file, '-').endswith('HalfDonut.stl')
E       AssertionError: assert False
E        +  where False = <built-in method endswith of str object at 0x0000029B4DBC7B10>('HalfDonut.stl')
E        +    where <built-in method endswith of str object at 0x0000029B4DBC7B10> = 'C:\\Users\\Oscar\\AppData\\Local\\Temp\\tmp55rp248i'.endswith
E        +      where 'C:\\Users\\Oscar\\AppData\\Local\\Temp\\tmp55rp248i' = <function test_args.<locals>._get_name at 0x0000029B53EFADC0>('C:\\Users\\Oscar\\numpy-stl\\tests\\stl_ascii\\HalfDonut.stl', '-')

I assume that 'C:\\Users\\Oscar\\AppData\\Local\\Temp\\tmp55rp248i' used to give some string starting with < in another versions?

(The same thing happens on the develop-branch so nothing in this PR causes it.)

wolph commented 1 year ago

Sorry for the very slow response... this one completely slipped by me.

With regards to the broken test, I'm guessing it's a windows specific issue. Apparently it's creating a temporary file here.

In any case, the changes look great :) I'm updating a few other things as well and I'll create a new release

wolph commented 1 year ago

Thank you for all the help!