Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLD: fix build failure py3.9.1 on OSX #38766

Merged
merged 3 commits into from
Dec 29, 2020
Merged

Conversation

jbrockmendel
Copy link
Member

Ran brew upgrade yesterday and ended up bumping from 3.9.0 to 3.9.1, after which I got build failures

    LooseVersion(python_target) < "10.9"
  File "/usr/local/Cellar/python@3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/version.py", line 306, in __init__
    self.parse(vstring)
  File "/usr/local/Cellar/python@3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/version.py", line 314, in parse
    components = [x for x in self.component_re.split(vstring)
TypeError: expected string or bytes-like object

No idea why this just started breaking now.

@@ -435,7 +435,7 @@ def run(self):
"MACOSX_DEPLOYMENT_TARGET", current_system
)
if (
LooseVersion(python_target) < "10.9"
LooseVersion(str(python_target)) < "10.9"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if https://docs.python.org/3/library/sysconfig.html#module-sysconfig returns a bytestring (e.g. get_config_vars())

weird

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int 11

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm that's also weird

@jreback jreback added the Build Library building on various platforms label Dec 29, 2020
@jreback jreback added this to the 1.2.1 milestone Dec 29, 2020
@jreback
Copy link
Contributor

jreback commented Dec 29, 2020

can you add a whatsnew note (1.2.1) as should backport this

@jbrockmendel
Copy link
Member Author

whatsnew added + green

@jreback jreback merged commit a27244d into pandas-dev:master Dec 29, 2020
@jreback
Copy link
Contributor

jreback commented Dec 29, 2020

@meeseeksdev backport 1.2.x

meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Dec 29, 2020
simonjayhawkins pushed a commit that referenced this pull request Dec 29, 2020
Co-authored-by: jbrockmendel <jbrockmendel@gmail.com>
@jbrockmendel jbrockmendel deleted the bld-391 branch December 29, 2020 15:57
luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
traviscook21 pushed a commit to traviscook21/python-sasl that referenced this pull request Oct 21, 2021
I was getting issues installing `sasl==0.3.1`:

```
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/81/kqvp0vjx63gfg5cbczsprwp00000gp/T/pip-install-4567bfnx/sasl_c72464a3686149948899242d98362bd1/setup.py", line 35, in <module>
      python_target = LooseVersion(
    File "/usr/local/Cellar/python@3.8/3.8.9/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/version.py", line 304, in __init__
      self.parse(vstring)
    File "/usr/local/Cellar/python@3.8/3.8.9/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/version.py", line 312, in parse
      components = [x for x in self.component_re.split(vstring)
  TypeError: expected string or bytes-like object
```

The specific source of the problem is that `get_config_var('MACOSX_DEPLOYMENT_TARGET')` was returning the integer `11`

This is a bug that was shipped in Python3.8 and Python3.9: https://bugs.python.org/issue42504

The comment above this section of code references a code pattern from Pandas.  Pandas also experienced this bug
and fixed it here: pandas-dev/pandas#38766

This commit implements the same fix.

As a workaround while this is prepped for release, I was able to `export MACOSX_DEPLOYMENT_TARGET=11` 
prior to running the install so that it skipped over the broken code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants