sdispater / pendulum

Python datetimes made easy
https://pendulum.eustace.io
MIT License
6.23k stars 386 forks source link

Version 1.4.3 failing to build on linux #185

Closed matmunn closed 1 year ago

matmunn commented 6 years ago

When building v1.4.3 as part of my CI flow I am presented with the following stack trace:

Failed to build pendulum
Installing collected packages: futures, gunicorn, MarkupSafe, Jinja2, Werkzeug, click, itsdangerous, flask, contextlib2, blinker, raven, humanize, pytz, six, python-dateutil, tzlocal, regex, dateparser, ruamel.ordereddict, ruamel.yaml, pytzdata, pendulum, snaptime, maya
  Running setup.py install for pendulum: started
    Running setup.py install for pendulum: finished with status 'error'
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6AgnIc/pendulum/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-SjOno3-record/install-record.txt --single-version-externally-managed --compile:
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/constants.py -> build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/_compat.py -> build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/exceptions.py -> build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/date.py -> build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/pendulum.py -> build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/helpers.py -> build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/time.py -> build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/__init__.py -> build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/version.py -> build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/parser.py -> build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/_global.py -> build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/period.py -> build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/interval.py -> build/lib.linux-x86_64-2.7/pendulum
    copying pendulum/translator.py -> build/lib.linux-x86_64-2.7/pendulum
    creating build/lib.linux-x86_64-2.7/pendulum/_extensions
    copying pendulum/_extensions/helpers.py -> build/lib.linux-x86_64-2.7/pendulum/_extensions
    copying pendulum/_extensions/__init__.py -> build/lib.linux-x86_64-2.7/pendulum/_extensions
    creating build/lib.linux-x86_64-2.7/pendulum/formatting
    copying pendulum/formatting/classic_formatter.py -> build/lib.linux-x86_64-2.7/pendulum/formatting
    copying pendulum/formatting/__init__.py -> build/lib.linux-x86_64-2.7/pendulum/formatting
    copying pendulum/formatting/formatter.py -> build/lib.linux-x86_64-2.7/pendulum/formatting
    copying pendulum/formatting/difference_formatter.py -> build/lib.linux-x86_64-2.7/pendulum/formatting
    copying pendulum/formatting/alternative_formatter.py -> build/lib.linux-x86_64-2.7/pendulum/formatting
    creating build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/ka.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/ar.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/da.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/hu.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/ro.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/tr.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/fi.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/vi.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/ja.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/he.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/id.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/sk.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/ca.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/zh.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/nl.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/sq.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/zh_tw.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/en.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/lt.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/ru.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/bn.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/az.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/__init__.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/it.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/cs.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/sl.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/fo.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/fr.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/sv.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/de.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/hy.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/bg.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/ko.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/af.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/et.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/ms.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/gl.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/sr.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/nn.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/pt_br.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/uz.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/eo.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/uk.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/pl.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/hr.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/mk.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/el.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/lv.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/es.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/fa.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/th.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    copying pendulum/lang/eu.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    creating build/lib.linux-x86_64-2.7/pendulum/mixins
    copying pendulum/mixins/__init__.py -> build/lib.linux-x86_64-2.7/pendulum/mixins
    copying pendulum/mixins/interval.py -> build/lib.linux-x86_64-2.7/pendulum/mixins
    copying pendulum/mixins/default.py -> build/lib.linux-x86_64-2.7/pendulum/mixins
    creating build/lib.linux-x86_64-2.7/pendulum/parsing
    copying pendulum/parsing/__init__.py -> build/lib.linux-x86_64-2.7/pendulum/parsing
    copying pendulum/parsing/parser.py -> build/lib.linux-x86_64-2.7/pendulum/parsing
    creating build/lib.linux-x86_64-2.7/pendulum/parsing/exceptions
    copying pendulum/parsing/exceptions/__init__.py -> build/lib.linux-x86_64-2.7/pendulum/parsing/exceptions
    creating build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/loader.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/local_timezone.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/exceptions.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/__init__.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/transition_type.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/timezone.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/timezone_info.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/transition.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    error: can't copy 'pendulum/lang': doesn't exist or not a regular file

Reverting to v1.4.2 for now has resolved the problem.

sdispater commented 6 years ago

That's weird. I can't reproduce on Ubuntu 16.04 and both Python 2.7 and Python 3.5.

Which Python version do you have?

matmunn commented 6 years ago

It's being built on Travis CI, in a docker container based on an ubuntu image with python 2.7.14

sdispater commented 6 years ago

I don't know what to do. I am unable to trigger this error.

What is the exact workflow that leads to this error?

matmunn commented 6 years ago

I was using the maya library which uses pendulum for parsing a bunch of dates, it failed during the pip install phase while trying to build pendulum.

From look at the stack trace it seems to be creating all the necessary files but then fails in a further step when trying to copy them all again.

I'll close this for now while I poke around and see if I can find a possible fix.

sdispater commented 6 years ago

Keep me posted.

Version 1.4.3 was the first to be released using poetry so something might be broken even though I didn't experience issues on my end.

farzadghanei commented 6 years ago

Same issue here, doing a pip install pendulum==1.5.1 (and 1.4.3) fails, but 1.4.2 was installed successfully. This is on Debian Wheezy, Python 2.7.3 virtualenv with pip==10.0.1 (setuptools is installed)

Last lines of the installation:

copying pendulum/lang/et.py -> build/lib.linux-x86_64-2.7/pendulum/lang
    creating build/lib.linux-x86_64-2.7/pendulum/mixins
    copying pendulum/mixins/interval.py -> build/lib.linux-x86_64-2.7/pendulum/mixins
    copying pendulum/mixins/default.py -> build/lib.linux-x86_64-2.7/pendulum/mixins
    copying pendulum/mixins/__init__.py -> build/lib.linux-x86_64-2.7/pendulum/mixins
    creating build/lib.linux-x86_64-2.7/pendulum/parsing
    copying pendulum/parsing/parser.py -> build/lib.linux-x86_64-2.7/pendulum/parsing
    copying pendulum/parsing/__init__.py -> build/lib.linux-x86_64-2.7/pendulum/parsing
    creating build/lib.linux-x86_64-2.7/pendulum/parsing/exceptions
    copying pendulum/parsing/exceptions/__init__.py -> build/lib.linux-x86_64-2.7/pendulum/parsing/exceptions
    creating build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/transition_type.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/exceptions.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/local_timezone.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/timezone.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/transition.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/__init__.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/loader.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    copying pendulum/tz/timezone_info.py -> build/lib.linux-x86_64-2.7/pendulum/tz
    error: can't copy 'pendulum/_extensions': doesn't exist or not a regular file
sdispater commented 6 years ago

That's weird. I still can't reproduce.

And the archive structure is the same so there should not be difference in the behavior.

The only difference I can think of right now is that the generated setup.py file no longer uses setuptools but distutils directly. I wonder if this could be the problem.

Which version of setuptools do you have?

sdispater commented 6 years ago

Ok. I just checked and the problem occurs only in you have setuptools<21.1.1.

Even though the generated setup.py does not use setuptools directly, setuptools monkey-patches distutils.

Anyway, if you want it to work you will have to upgrade setuptools: pip install -U setuptools and it should work.

olegTarassov commented 5 years ago

I was able to isolate the issue by downgrading pip to version 18.1 from 19.0.1 which was the Root Cause. Environment: Python version is 2.7.5 setuptool version is 40.8.0. pendulum version is 2.0.4

cognifloyd commented 5 years ago

This worked for me. CentOS 7.5.1804 Python 2.7.5 setuptools 0.9.8 pip 18.1 pendulum 2.0.5

But if I upgraded to pip 19+, I got errors similar to these. Of note, I'm using an ancient version of setuptools. so setuptools seems to not be the issue.

Secrus commented 1 year ago

Should be fixed in modern Python, setuptools and Pendulum versions