Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVNIndexXSLT Skipping page because of Content-Type: text/xml #3391

Closed
simon-graham opened this issue Jan 20, 2016 · 1 comment
Closed

SVNIndexXSLT Skipping page because of Content-Type: text/xml #3391

simon-graham opened this issue Jan 20, 2016 · 1 comment
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@simon-graham
Copy link

Our SVN server uses the SVNIndexXSLT directive to customize the look when viewed in a web browser. We use the svnindex.xsl file from here.

We have set up a repository which contains all of our wheel files and would like to have pip install grab the wheel files directly from the SVN repo URL.

The pip install command fails apparently because the content-type returned by the repository is text/xml and the _get_page() function in index.py explicitly disallows any content-type other than text/html.

Would it be feasible to add support for parsing xml in addition to html?

The pip error message is:

pip install --use-wheel --no-index --find-links=http://code.ourcompany.com/svn/third-party/wheelhouse/trunk --trusted-host=code.ourcompany.com --verbose -r ../requirements/requirements.txt
Ignoring indexes: https://pypi.python.org/simple
Collecting cffi==1.5.0 (from -r ../requirements/requirements.txt (line 1))
  1 location(s) to search for versions of cffi:
  * http://code.ourcompany.com/svn/third-party/wheelhouse/trunk
  Skipping link http://code.ourcompany.com/svn/third-party/wheelhouse/trunk (from -f); not a file
  Getting page http://code.ourcompany.com/svn/third-party/wheelhouse/trunk
  Starting new HTTP connection (1): code.ourcompany.com
  "GET /svn/third-party/wheelhouse/trunk HTTP/1.1" 301 355
  Resetting dropped connection: code.ourcompany.com
  "GET /svn/third-party/wheelhouse/trunk/ HTTP/1.1" 200 2254
  Skipping page http://code.ourcompany.com/svn/third-party/wheelhouse/trunk because of Content-Type: text/xml
  Could not find a version that satisfies the requirement cffi==1.5.0 (from -r ../requirements/requirements.txt (line 1)) (from versions: )
Cleaning up...
No matching distribution found for cffi==1.5.0 (from -r ../requirements/requirements.txt (line 1))
Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 310, in run
    wb.build(autobuilding=True)
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 747, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 359, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 511, in _prepare_file
    finder, self.upgrade, require_hashes)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 271, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/local/lib/python2.7/site-packages/pip/index.py", line 485, in find_requirement
    'No matching distribution found for %s' % req
DistributionNotFound: No matching distribution found for cffi==1.5.0 (from -r ../requirements/requirements.txt (line 1))

The page returned by the SVN repo looks like this:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/svnindex.xsl"?>
<!DOCTYPE svn [
  <!ELEMENT svn   (index)>
  <!ATTLIST svn   version CDATA #REQUIRED
                  href    CDATA #REQUIRED>
  <!ELEMENT index (updir?, (file | dir)*)>
  <!ATTLIST index name    CDATA #IMPLIED
                  path    CDATA #IMPLIED
                  rev     CDATA #IMPLIED
                  base    CDATA #IMPLIED>
  <!ELEMENT updir EMPTY>
  <!ATTLIST updir href    CDATA #REQUIRED>
  <!ELEMENT file  EMPTY>
  <!ATTLIST file  name    CDATA #REQUIRED
                  href    CDATA #REQUIRED>
  <!ELEMENT dir   EMPTY>
  <!ATTLIST dir   name    CDATA #REQUIRED
                  href    CDATA #REQUIRED>
]>
<svn version="1.8.13 (r1667537)"
     href="http://subversion.apache.org/">
  <index rev="72" path="/wheelhouse/trunk" base="third-party">
    <updir href="../"/>
    <file name="cffi-1.5.0-cp27-none-linux_x86_64.whl" href="cffi-1.5.0-cp27-none-linux_x86_64.whl" />
    <file name="cryptography-1.2.1-cp27-none-linux_x86_64.whl" href="cryptography-1.2.1-cp27-none-linux_x86_64.whl" />
    <file name="enum34-1.1.2-py2-none-any.whl" href="enum34-1.1.2-py2-none-any.whl" />
    <file name="idna-2.0-py2.py3-none-any.whl" href="idna-2.0-py2.py3-none-any.whl" />
    <file name="ipaddress-1.0.16-py27-none-any.whl" href="ipaddress-1.0.16-py27-none-any.whl" />
    <file name="mailinglogger-3.8.0-py2-none-any.whl" href="mailinglogger-3.8.0-py2-none-any.whl" />
    <file name="ndg_httpsclient-0.4.0-py2-none-any.whl" href="ndg_httpsclient-0.4.0-py2-none-any.whl" />
    <file name="pyOpenSSL-0.15.1-py2.py3-none-any.whl" href="pyOpenSSL-0.15.1-py2.py3-none-any.whl" />
    <file name="pyasn1-0.1.9-py2.py3-none-any.whl" href="pyasn1-0.1.9-py2.py3-none-any.whl" />
    <file name="pycparser-2.14-py2-none-any.whl" href="pycparser-2.14-py2-none-any.whl" />
    <file name="setuptools-19.4-py2.py3-none-any.whl" href="setuptools-19.4-py2.py3-none-any.whl" />
    <file name="six-1.10.0-py2.py3-none-any.whl" href="six-1.10.0-py2.py3-none-any.whl" />
    <file name="tendo-0.2.8-py2.py3-none-any.whl" href="tendo-0.2.8-py2.py3-none-any.whl" />
    <file name="wheel-0.26.0-py2.py3-none-any.whl" href="wheel-0.26.0-py2.py3-none-any.whl" />
  </index>
</svn>

Tested using Python 2.7.8, SVN 1.8.13, pip 7.1.2 and pip 8.0.0, wheel 0.26.0.

@dstufft
Copy link
Member

dstufft commented Mar 24, 2017

Closing this, PEP 503 explicitly requires everything to be HTML. Supporting beyond that would require a PEP.

@dstufft dstufft closed this as completed Mar 24, 2017
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

2 participants