Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix Appveyor build. #8334

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

Merged
merged 1 commit into from
Mar 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix Appveyor build.
Recent condas prefer (by default) packages in higher priority channels
to packages in lower priority channels regardless of their versions.
conda-forge sometimes serves older condas than the official repos, so we
need to put it at the end to avoid accidentally downgrading conda.

Do not depend on the user name to construct a temporary cache directory
when needed, as e.g. conda-build hides the required environment variable
(`%USERNAME%`) on Windows.

Simplify implementation of `matplotlib_fname`.
  • Loading branch information
anntzer committed Mar 19, 2017
commit 0140c8427db0fab273b00b03233e05d68c4f4ffb
4 changes: 3 additions & 1 deletion 4 appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ install:
# for obvci_appveyor_python_build_env.cmd
- cmd: conda install -c pelson/channel/development --yes --quiet obvious-ci
# for msinttypes and newer stuff
- cmd: conda config --add channels conda-forge
# conda-forge may serve outdated versions of certain packages (e.g. conda
# itself), so append it to the end of the list.
- cmd: conda config --append channels conda-forge
Copy link
Member

Choose a reason for hiding this comment

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

The opposite is true as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Right now conda-forge is serving an outdated version of conda which is the reason the Appveyor build broke. I would hope that the official conda channel never serves an outdated version of conda... I don't think serving outdated versions of other build dependencies is as much of an issue (if any).
  2. I could instead set the channel_priority option documented at https://conda.io/docs/channels.html#managing-conda-channels, but there are other issues with that (see the link). I don't have a strong opinion though.

Copy link
Member

Choose a reason for hiding this comment

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

conda-build 2.1.7 has now been released on conda-forge for windows py2.7.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like this is not enough, I guess we also need a more recent version of conda itself (I guess what happens is that a recent conda-build exposes a bug in an old version of conda), see latest appveyor builds which fail with conda 4.2.13+conda-build 2.1.7 (vs my PR which uses 4.3.14/2.1.7)

- cmd: conda config --set show_channel_urls yes
- cmd: conda config --set always_yes true
# For building conda packages
Expand Down
61 changes: 20 additions & 41 deletions 61 lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,26 +575,15 @@ def _create_tmp_config_dir():

Returns None if a writable temporary directory could not be created.
"""
import getpass
import tempfile
from matplotlib.cbook import mkdirs

try:
tempdir = tempfile.gettempdir()
except NotImplementedError:
# Some restricted platforms (such as Google App Engine) do not provide
# gettempdir.
return None
try:
username = getpass.getuser()
except KeyError:
username = str(os.getuid())

tempdir = tempfile.mkdtemp(prefix='matplotlib-%s-' % username, dir=tempdir)

os.environ['MPLCONFIGDIR'] = tempdir

return tempdir
configdir = os.environ['MPLCONFIGDIR'] = (
tempfile.mkdtemp(prefix='matplotlib-', dir=tempdir))
return configdir


get_home = verbose.wrap('$HOME=%s', _get_home, always=False)
Expand Down Expand Up @@ -805,34 +794,24 @@ def matplotlib_fname():
- Lastly, it looks in `$MATPLOTLIBDATA/matplotlibrc` for a
system-defined copy.
"""
if six.PY2:
cwd = os.getcwdu()
else:
cwd = os.getcwd()
fname = os.path.join(cwd, 'matplotlibrc')
if os.path.exists(fname):
return fname

if 'MATPLOTLIBRC' in os.environ:
path = os.environ['MATPLOTLIBRC']
if os.path.exists(path):
if os.path.isfile(path):
return path
fname = os.path.join(path, 'matplotlibrc')
if os.path.exists(fname):
return fname

configdir = _get_configdir()
if os.path.exists(configdir):
fname = os.path.join(configdir, 'matplotlibrc')
if os.path.exists(fname):
return fname

path = get_data_path() # guaranteed to exist or raise
fname = os.path.join(path, 'matplotlibrc')
if not os.path.exists(fname):
warnings.warn('Could not find matplotlibrc; using defaults')

def gen_candidates():
yield os.path.join(six.moves.getcwd(), 'matplotlibrc')
try:
matplotlibrc = os.environ['MATPLOTLIBRC']
except KeyError:
pass
else:
yield matplotlibrc
yield os.path.join(matplotlibrc, 'matplotlibrc')
yield os.path.join(_get_configdir(), 'matplotlibrc')
yield os.path.join(get_data_path(), 'matplotlibrc')

for fname in gen_candidates():
if os.path.isfile(fname):
break
# Return first candidate that is a file, or last candidate if none is
# valid (in that case, a warning is raised at startup by `rc_params`).
return fname


Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.