Pandas version checks
-
[X] I have checked that this issue has not already been reported.
-
[X] I have confirmed this bug exists on the latest version of pandas.
-
[X] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
git clone https://github.com/pandas-dev/pandas.git
cd pandas
python3 setup.py build_ext --inplace
Issue Description
The above raises
Traceback (most recent call last):
File "/tmp/pandas/setup.py", line 666, in <module>
version=versioneer.get_version(),
File "<string>", line 1800, in get_version
File "<string>", line 1732, in get_versions
File "<string>", line 396, in get_config_from_root
File "/usr/lib/python3.9/configparser.py", line 781, in get
d = self._unify_values(section, vars)
File "/usr/lib/python3.9/configparser.py", line 1149, in _unify_values
raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'versioneer'
Expected Behavior
This command has always worked, at least until April.
I have tried to understand what to do from https://github.com/python-versioneer/python-versioneer , and it says that the section is required in setup.cfg
or pyproject.toml
(and we have the latter). So not sure why it fails. In any case, copypasting the section also to setup.cfg
and running versioneer install --no-vendor
gives:
/home/nobackup/repo/pandas
creating "pandas/_version.py"
Traceback (most recent call last):
File "/home/pietro/.local/bin/versioneer", line 8, in <module>
sys.exit(main())
File "/home/pietro/.local/lib/python3.9/site-packages/versioneer.py", line 1932, in main
setup_command()
File "<string>", line 2197, in setup_command
File "<string>", line 2118, in do_setup
FileNotFoundError: [Errno 2] No such file or directory: '"pandas/_version.py"'
... which is to me even more weird - pandas/_version.py
is definitely there.
I guess this might be related to https://github.com/pandas-dev/pandas/pull/49924 , but I hadn't compiled pandas since months, so I'm not sure.
Installed Versions
Notice that the commit
is wrong. I'm on 7d2337a34828e3ed645498d0ea37ca9ceb3fa31a , which however I can't compile. Also notice that versioneer is 0.28. Also notice that the bug is not tested with the last version of pandas - it's in git only. However if I don't check the box at the top it won't let me submit the issue.
Comment From: MarcoGorelli
versioneer
has been added to environment.yml
and requirements-dev.txt
, you'll need to re-build your environment
Comment From: toobaz
versioneer
has been added toenvironment.yml
andrequirements-dev.txt
, you'll need to re-build your environment
I do have versioneer
installed. What environment do you refer to? I'm just doing the above in a shell, with all required dependencies installed.
Comment From: MarcoGorelli
your development environment
can you try to install versioneer[toml]
?
either that, or try clearing non-tracked files git clean -fxfd pandas
building from source definitely works, we did a couple of sprints last week
Comment From: toobaz
can you try to install
versioneer[toml]
?
Aha, that was it. Sorry for the noise, I had no idea it was a different package altogether.
Comment From: ChristopherDavisUCI
This thread was helpful to me, thank you! In my Mac terminal, I had to put quotation marks around versioneer[toml]
, so I had to type pip install 'versioneer[toml]'
. Just wanted to post that in case anyone else is stuck in the same place.