apple / ccs-caldavtester

CalDAV/CardDAV Testing Framework used by CalendarServer
https://www.calendarserver.org
Apache License 2.0
57 stars 36 forks source link

Build failure: NameError: name 'file' is not defined #39

Open minfrin opened 4 years ago

minfrin commented 4 years ago

While trying the "pip install" step in the install instructions, the build fails as below.

Little-Net:ccs-caldavtester minfrin$ virtualenv venv
created virtual environment CPython3.7.7.final.0-64 in 460ms
  creator CPython3Posix(dest=/Users/minfrin/src/apache/sandbox/calendar/ccs-caldavtester/venv, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/Users/minfrin/Library/Application Support/virtualenv/seed-app-data/v1.0.1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
Little-Net:ccs-caldavtester minfrin$ source venv/bin/activate
(venv) Little-Net:ccs-caldavtester minfrin$ pip install -r requirements.txt
Obtaining file:///Users/minfrin/src/apache/sandbox/calendar/ccs-caldavtester (from -r requirements.txt (line 5))
    ERROR: Command errored out with exit status 1:
     command: /Users/minfrin/src/apache/sandbox/calendar/ccs-caldavtester/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/minfrin/src/apache/sandbox/calendar/ccs-caldavtester/setup.py'"'"'; __file__='"'"'/Users/minfrin/src/apache/sandbox/calendar/ccs-caldavtester/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info
         cwd: /Users/minfrin/src/apache/sandbox/calendar/ccs-caldavtester/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/minfrin/src/apache/sandbox/calendar/ccs-caldavtester/setup.py", line 169, in <module>
        long_description = file(joinpath(dirname(__file__), "README.md")).read()
    NameError: name 'file' is not defined
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
dreness commented 4 years ago

Hi @minfrin - Unfortunately CalDAVTester requires python 2.7, which is end of life. I can’t say I recommend using python 2 at this point, however it should still work. One silver lining I guess is that because CalDAV tester is a purely over-the-wire test suite, it is totally isolated from whatever server it is testing against.

This project has historically been maintained alongside CalendarServer, which was “archived” some months ago. CalDAVTester may have broader use than CalendarServer did, as it is (as far as I know) the most complete CalDAV conformance test suite. All the same, we would likely rely on community contributions to get this project python3 clean.

claudep commented 3 years ago

A first step towards Python 3 compatibility is proposed in PR #40.