Esri / ArcREST

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

Make pip installable #256

Closed pykler closed 8 years ago

pykler commented 8 years ago

Currently this repo is not directly installable, it is neither uploaded to pypi nor is in installable with the following expression

pip install git+https://github.com/Esri/ArcREST.git

Similarly the source archives are not. This is because setup.py is not at the root of the repo.

Another issue, this repo is named ArcRest which is a name that is already taken in pypi, so sticking with this name moving forward will only make things more problematic.

Steps to solve these issues

  1. Rename the package to ArcRestPy or similar (just the package name in setup.py no need to rename the repo)
  2. register that name in pypi asap to reserve it.
  3. Upload the dist package to pypi https://pythonhosted.org/an_example_pypi_project/setuptools.html#uploading-your-project
  4. Work on setting up this repo with a standard python repo layout.
pykler commented 8 years ago

I now see that this is actually uploaded to pypi as https://pypi.python.org/pypi/ArcREST_Package since the name in setup.py is different than on pypi, this is a little problematic but a good first step.

pykler commented 8 years ago

And it doesnt actually install from pypi either 😱

% pip install ArcREST_Package
Collecting ArcREST_Package
  Downloading ArcREST_Package-3.5.3.tar.gz (1.1MB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.1MB 966kB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/hatem/.virtualenvs/tmp3/lib/python3.4/tokenize.py", line 437, in open
        buffer = builtins.open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/b0/_3p5d82134n8xtp1l9zlh_200000gn/T/pip-build-lhkmejr2/ArcREST-Package/setup.py'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/b0/_3p5d82134n8xtp1l9zlh_200000gn/T/pip-build-lhkmejr2/ArcREST-Package/
achapkowski commented 8 years ago

@pykler We will take a look.

achapkowski commented 8 years ago

@pykler You can now do: pip install arcrest_package

pykler commented 8 years ago

Yes doing that doesn't work. So the package uploaded to pypi is broken and can never be installed because setup tools can't find the setup.py file. On Jun 10, 2016 8:32 AM, "Andrew" notifications@github.com wrote:

@pykler https://github.com/pykler You can not do: pip install arcrest_package

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Esri/ArcREST/issues/256#issuecomment-225159325, or mute the thread https://github.com/notifications/unsubscribe/AACwWtnJcAptM2HsOpneKX3_awsl1AE8ks5qKUtVgaJpZM4Ix-fV .

achapkowski commented 8 years ago

@pykler it works for me.

achapkowski commented 8 years ago

@pykler please post your error. Make sure you aren't using a cached version. I removed the old versions this morning.

pykler commented 8 years ago

works now, thanks. Can you please add the pip install command to the readme, it will make it easier for people to find since the pypi name is different from the package name.

pykler commented 8 years ago

Also the latest version is now 3.5.6 as of pypi, so another thing to perhaps add to the README.

lsloan commented 8 years ago

Ideally, it should be installable with either command:

pip install git+https://github.com/Esri/ArcREST.git

or

pip install arcrest_package

Also, arcrest_package is a rather awkward name. Why not name it esri_arcrest?

lsloan commented 8 years ago

It bothered me that installation by git repository URL downloads the code and attempts to install, but fails because of the incorrect structure of this project. I thought that pip must have (or should have) some way to specify that it should look in a different directory.

It does. It just needs a specially formatted addition to the URL.

The command using the URL with a specially formatted fragment suffix for installing the version 3.5.3 tag (Hey! Where's the 3.5.6 tagβ€½) is:

pip install 'git+https://github.com/Esri/ArcREST.git@3.5.3#egg=arcrest&subdirectory=src'

Version 3.5.6 may be installed (even though it's not been tagged), by installing from the default branch:

pip install 'git+https://github.com/Esri/ArcREST.git#egg=arcrest&subdirectory=src'

Although this information will help others install ArcREST with its current directory structure, I hope that doesn't keep the development team from correcting the layout.