meshio icon indicating copy to clipboard operation
meshio copied to clipboard

Add developer install instructions

Open banesullivan opened this issue 3 years ago • 10 comments

pip install -e .

does not work on Python 3.8 after cloning

$ pip install -e .
ERROR: File "setup.py" not found. Directory cannot be installed in editable mode: /Users/bane/Software/external/meshio
(A "pyproject.toml" file was found, but editable mode currently requires a setup.py based build.)
>>> import scooby
>>> scooby.Report(['setuptools', 'distutils'])

--------------------------------------------------------------------------------
  Date: Mon Nov 29 11:40:24 2021 MST

                OS : Darwin
            CPU(s) : 16
           Machine : x86_64
      Architecture : 64bit
       Environment : Python

  Python 3.8.8 | packaged by conda-forge | (default, Feb 20 2021, 16:12:38)
  [Clang 11.0.1 ]

        setuptools : 49.6.0.post20210108
         distutils : 3.8.8
             numpy : 1.20.2
             scipy : 1.6.3
           IPython : 7.22.0
        matplotlib : 3.4.1
            scooby : 0.5.7
--------------------------------------------------------------------------------

It appears the setup.py was removed (without warning?) in https://github.com/nschloe/meshio/pull/795

Since the typical way of installing isn't working, there should be an explanation of the usage of setup.cfg in the README and how to install this locally

banesullivan avatar Nov 29 '21 18:11 banesullivan

I just use tox for testing and install it with from pypi or pip install ..

nschloe avatar Nov 29 '21 18:11 nschloe

But then you cannot edit the source and it be reflected in the environment. For example check this out:

I updated the init of meshio with this diff (after installing):

diff --git a/src/meshio/__init__.py b/src/meshio/__init__.py
index 035ae53..36c81ae 100644
--- a/src/meshio/__init__.py
+++ b/src/meshio/__init__.py
@@ -80,3 +80,5 @@ __all__ = [
     "topological_dimension",
     "__version__",
 ]
+
+print('this has been editted')

But then if I import meshio into Python, I cannot see that change:

$ meshio git:(main) ✗ python
Python 3.8.8 | packaged by conda-forge | (default, Feb 20 2021, 16:12:38)
[Clang 11.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import meshio
>>>

In order to see the change I have to install it again:

$ meshio git:(main) ✗ pip install .
...
$ meshio git:(main) ✗ python
Python 3.8.8 | packaged by conda-forge | (default, Feb 20 2021, 16:12:38)
[Clang 11.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import meshio
this has been editted
>>>

Without a setup.py there is no way to do a dev install (AFAIK)

banesullivan avatar Nov 29 '21 19:11 banesullivan

How about tox?

nschloe avatar Nov 29 '21 19:11 nschloe

Well the point is that I want to use meshio in an arbitrary virtual env outside the context of tox and testing. Can the setup.py that was removed in #795 be added back?

banesullivan avatar Nov 29 '21 20:11 banesullivan

Without a setup.py there is no way to do a dev install (AFAIK)

This is also what I found. pip cannot do an editable install without a setup.py, so it seems that setup.cfg/pyproject.toml cannot completely replace setup.py yet.

stefsmeets avatar Dec 23 '21 14:12 stefsmeets

For the time being, you could simply add a setup.py locally.

nschloe avatar Dec 23 '21 14:12 nschloe

Yep, that's what I did 👍

stefsmeets avatar Dec 23 '21 15:12 stefsmeets

A bit embarrassingly, this took me about an hour to figure out. IMO, meshio should keep a setup.py until the new package config can support editable installations

banesullivan avatar Dec 23 '21 16:12 banesullivan

Or at least dev install instructions outlining the need for this file

banesullivan avatar Dec 23 '21 16:12 banesullivan

IMO, meshio should keep a setup.py until the new package config can support editable installations

Fair enough, fair enough. I'll add one.

nschloe avatar Dec 23 '21 17:12 nschloe