title: pip - `git+file` doesn't work with setup.cfg
body: <p>I want to refer to dependency on the local filesystem in <code>setup.cfg</code>.</p>
  
  <hr>
  
  <p>When I perform the following on the command line:</p>
  
  <pre><code>$  pip install  git+file:///Users/Dev/Projects/dakia/#subdirectory=server
  </code></pre>
  
  <p>It works flawlessly, as described in the <a href="https://pip.pypa.io/en/stable/reference/pip_install/#git" rel="nofollow noreferrer">manual</a>.</p>
  
  <hr>
  
  <p>But if I specify the same in <code>setup.cfg</code>, like so:</p>
  
  <pre><code>[options]
      dakia @ git+file:///Users/Dev/Projects/dakia/#subdirectory=server
  </code></pre>
  
  <p>It fails with the following trace:</p>
  
  <pre><code>$  pip install -v -e .[dev]
  Created temporary directory: /private/var/folders/p6/hs3yrbfn0tn96llkwpjl1q4h0000gn/T/pip-ephem-wheel-cache-_4jzvm87
  Created temporary directory: /private/var/folders/p6/hs3yrbfn0tn96llkwpjl1q4h0000gn/T/pip-req-tracker-p7l48gck
  Created requirements tracker '/private/var/folders/p6/hs3yrbfn0tn96llkwpjl1q4h0000gn/T/pip-req-tracker-p7l48gck'
  Created temporary directory: /private/var/folders/p6/hs3yrbfn0tn96llkwpjl1q4h0000gn/T/pip-install-gwp9chgb
  Obtaining file:///Users/dev/Projects/dara/server
    Added file:///Users/dev/Projects/dara/server to build tracker '/private/var/folders/p6/hs3yrbfn0tn96llkwpjl1q4h0000gn/T/pip-req-tracker-p7l48gck'
      Running setup.py (path:/Users/dev/Projects/dara/server/setup.py) egg_info for package from file:///Users/dev/Projects/dara/server
      Running command python setup.py egg_info
      Traceback (most recent call last):
        File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3101, in __init__
          super(Requirement, self).__init__(requirement_string)
        File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 101, in __init__
          raise InvalidRequirement("Invalid URL given")
      pkg_resources.extern.packaging.requirements.InvalidRequirement: Invalid URL given
  
      During handling of the above exception, another exception occurred:
  
      Traceback (most recent call last):
        File "&lt;string&gt;", line 1, in &lt;module&gt;
        File "/Users/dev/Projects/dara/server/setup.py", line 3, in &lt;module&gt;
          setup()
        File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/setuptools/__init__.py", line 144, in setup
          _install_setup_requires(attrs)
        File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/setuptools/__init__.py", line 137, in _install_setup_requires
          dist.parse_config_files(ignore_option_errors=True)
        File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/setuptools/dist.py", line 701, in parse_config_files
          self._finalize_requires()
        File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/setuptools/dist.py", line 505, in _finalize_requires
          self._move_install_requirements_markers()
        File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/setuptools/dist.py", line 544, in _move_install_requirements_markers
          inst_reqs = list(pkg_resources.parse_requirements(spec_inst_reqs))
        File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3094, in parse_requirements
          yield Requirement(line)
        File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3103, in __init__
          raise RequirementParseError(str(e))
      pkg_resources.RequirementParseError: Invalid URL given
  Cleaning up...
  Removed file:///Users/dev/Projects/dara/server from build tracker '/private/var/folders/p6/hs3yrbfn0tn96llkwpjl1q4h0000gn/T/pip-req-tracker-p7l48gck'
  Removed build tracker '/private/var/folders/p6/hs3yrbfn0tn96llkwpjl1q4h0000gn/T/pip-req-tracker-p7l48gck'
  ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Exception information:
  Traceback (most recent call last):
    File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
      status = self.run(options, args)
    File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 382, in run
      resolver.resolve(requirement_set)
    File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 201, in resolve
      self._resolve_one(requirement_set, req)
    File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 365, in _resolve_one
      abstract_dist = self._get_abstract_dist_for(req_to_install)
    File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 295, in _get_abstract_dist_for
      req, self.require_hashes, self.use_user_site, self.finder,
    File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 258, in prepare_editable_requirement
      req, self.req_tracker, finder, self.build_isolation,
    File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 49, in _get_prepared_distribution
      abstract_dist.prepare_distribution_metadata(finder, build_isolation)
    File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pip/_internal/distributions/source/legacy.py", line 39, in prepare_distribution_metadata
      self.req.prepare_metadata()
    File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 563, in prepare_metadata
      self.metadata_directory = metadata_generator(self)
    File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pip/_internal/operations/generate_metadata.py", line 124, in _generate_metadata_legacy
      command_desc='python setup.py egg_info',
    File "/Users/dev/.pyenv/versions/anaconda3-2018.12/lib/python3.7/site-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess
      raise InstallationError(exc_msg)
  pip._internal.exceptions.InstallationError: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  </code></pre>
  
  <p>How do I make <code>git+file</code> urls work with <code>setup.cfg</code>?
  Is that not possible? If so, why? </p>
  
  <hr>
  
  <p>I don't think this post needs any more explanation, but SO won't let me post without a certain amount of text.</p>