gsemet/pipenv-to-requirements

Latest build of Pipenv breaks pipenv-to-requirements

Opened this issue · 1 comments

So if I do a clean install & it uses today's Pipenv, the Project object blows up on missing get()
If I pin to something earlier (I randomly picked 2022.9.8) then it doesn't immediately blow up.

Pinning or updating so it is backwards compatible would be helpful.

For others, what I did was pipx install this, and then run pipx inject to force the compatible version of pipenv.

λ pipenv install pipenv_to_requirements --skip-lock
Creating a virtualenv for this project...
Pipfile: ptr\Pipfile
Using C:/Program Files/Python310/python.exe (3.10.4) to create virtualenv...
[    ] Creating virtual environment...created virtual environment CPython3.10.4.final.0-64 in 5478ms
  creator CPython3Windows(dest=\.virtualenvs\ptr-THuuTc3s, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=pypa\virtualenv)
    added seed packages: pip==22.2.2, setuptools==65.3.0, wheel==0.37.1
  activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

Successfully created virtual environment!
Virtualenv location: \.virtualenvs\ptr-THuuTc3s
Creating a Pipfile for this project...
Installing pipenv_to_requirements...
Adding pipenv_to_requirements to Pipfile's [packages]...
Installation Succeeded
Installing dependencies from Pipfile...
  ================================ 0/0 - 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
λ pipenv shell
Launching subshell in virtual environment...
λ pipenv_to_requirements
Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\matth\.virtualenvs\ptr-THuuTc3s\Scripts\pipenv_to_requirements.exe\__main__.py", line 7, in <module>
  File "C:\Users\matth\.virtualenvs\ptr-THuuTc3s\lib\site-packages\pipenv_to_requirements\__init__.py", line 115, in main
    def_req = parse_pip_file(pipfile, 'default')
  File "C:\Users\matth\.virtualenvs\ptr-THuuTc3s\lib\site-packages\pipenv_to_requirements\__init__.py", line 66, in parse_pip_file
    return [clean_version(n, i) for n, i in pipfile.get(section, {}).items()]
AttributeError: 'function' object has no attribute 'get'
λ pip install pipenv==2022.9.8
Collecting pipenv==2022.9.8
  Downloading pipenv-2022.9.8-py2.py3-none-any.whl (3.3 MB)
     ---------------------------------------- 3.3/3.3 MB 1.5 MB/s eta 0:00:00
Requirement already satisfied: setuptools>=36.2.1 in c:\users\matth\.virtualenvs\ptr-thuutc3s\lib\site-packages (from pipenv==2022.9.8) (65.3.0)
Requirement already satisfied: certifi in c:\users\matth\.virtualenvs\ptr-thuutc3s\lib\site-packages (from pipenv==2022.9.8) (2022.9.24)
Requirement already satisfied: virtualenv-clone>=0.2.5 in c:\users\matth\.virtualenvs\ptr-thuutc3s\lib\site-packages (from pipenv==2022.9.8) (0.5.7)
Requirement already satisfied: virtualenv in c:\users\matth\.virtualenvs\ptr-thuutc3s\lib\site-packages (from pipenv==2022.9.8) (20.16.5)
Requirement already satisfied: filelock<4,>=3.4.1 in c:\users\matth\.virtualenvs\ptr-thuutc3s\lib\site-packages (from virtualenv->pipenv==2022.9.8) (3.8.0)
Requirement already satisfied: platformdirs<3,>=2.4 in c:\users\matth\.virtualenvs\ptr-thuutc3s\lib\site-packages (from virtualenv->pipenv==2022.9.8) (2.5.2)
Requirement already satisfied: distlib<1,>=0.3.5 in c:\users\matth\.virtualenvs\ptr-thuutc3s\lib\site-packages (from virtualenv->pipenv==2022.9.8) (0.3.6)
Installing collected packages: pipenv
  Attempting uninstall: pipenv
    Found existing installation: pipenv 2022.10.12
    Uninstalling pipenv-2022.10.12:
      Successfully uninstalled pipenv-2022.10.12
Successfully installed pipenv-2022.9.8
λ pipenv_to_requirements
INFO:pipenv_to_requirements:generated: requirements.txt

Sorry I do no use pipenv any more but if you have a fix to support the new version I can release a new version