Esri / ArcREST

python package for REST API (AGS, AGOL, webmap JSON, etc..)
Apache License 2.0
192 stars 155 forks source link

Bad package structure #188

Closed lobsteropteryx closed 8 years ago

lobsteropteryx commented 8 years ago

Looks like pip install arcrest-package for the latest (3.5.3) version is failing. I believe this is because the whole directory structure is getting packaged up, rather than just src; the zip structure looks like:

C:.
└───ArcREST_Package-3.5.3
    └───ArcREST-3.5.3
        ├───docs
        │   ├───.doctrees
        │   └───_sources
        ├───samples
        │   ├───AGOLMapServices
        │   ├───AGS
        │   ├───HostedFeatureServiceAd
        │   └───Workforce
        ├───src
        │   ├───arcrest
        │   │   ├───agol
        │   │   │   └───helperservices
        │   │   ├───ags
        │   │   ├───cmp
        │   │   ├───common
        │   │   ├───enrichment
        │   │   ├───geometryservice
        │   │   ├───hostedservice
        │   │   ├───manageags
        │   │   ├───manageorg
        │   │   ├───manageportal
        │   │   ├───opendata
        │   │   ├───packages
        │   │   │   └───ntlm3
        │   │   ├───security
        │   │   ├───web
        │   │   ├───webmap
        │   │   └───_abstract
        │   └───arcresthelper
        │       └───packages
        ├───tests
        └───tools
            ├───helpDocs
            └───src
$ pip install arcrest-package
Collecting arcrest-package
  Using cached ArcREST_Package-3.5.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    IOError: [Errno 2] No such file or directory: 'c:\\users\\ifirkin\\appdata\\local\\temp\\pip-build-qhvgz0\\arcrest-package\\setup.py'
achapkowski commented 8 years ago

Any recommendations on how to fix?

lobsteropteryx commented 8 years ago

Sure--setup.py needs to be in the root. I don't know if that means you'll have to update paths or not; I could take a crack at it if you like.

EDIT: Normally you want everything referenced from the root dir; so you could just package up the src directory, and that would work, keeping all the import statements the same.

If you want to ship tests, docs, etc., you probably need to rearrange some things; A good reference is http://python-packaging.readthedocs.org/en/latest/minimal.html

Also, I noticed that there are some old PYPI aliases out there-- pip install arcrest, for example, pulls down a very incompatible version.

achapkowski commented 8 years ago

@lobsteropteryx - please take a crack at it.

lobsteropteryx commented 8 years ago

Will do, thanks. Would you prefer to ship everything in the pip package? Docs, examples, etc.?

achapkowski commented 8 years ago

@lobsteropteryx thank you for your pull request, we are reworking the package for release 4.0.0, so I'm going to close this issue and try to ensure I make a better package in the future.