{"id":3219,"date":"2018-04-17T14:06:59","date_gmt":"2018-04-17T12:06:59","guid":{"rendered":"http:\/\/blog.gocept.com\/?p=3219"},"modified":"2018-04-18T09:07:53","modified_gmt":"2018-04-18T07:07:53","slug":"allow-hosts-in-buildout-considered-harmful","status":"publish","type":"post","link":"https:\/\/blog.gocept.com\/2018\/04\/17\/allow-hosts-in-buildout-considered-harmful\/","title":{"rendered":"“allow-hosts” in buildout considered harmful"},"content":{"rendered":"

Today we had the following error message when re-installing a project from scratch:<\/p>\n

 While:\n   Installing.\n   Getting section application.\n   Initializing section application.\n   Installing recipe zc.zope3recipes.\n   Getting distribution for 'zc.zope3recipes==0.13.0'.\n Error: Couldn't find a distribution for 'zc.zope3recipes==0.13.0'.<\/pre>\n

Yes this is a really old recipe but it still exists on PyPI<\/a>. We are using zc.buildout<\/code>\u00a0in Version 2.10<\/code>, and do not use a custom index<\/code>. So being forced to use HTTPS to access PyPI does not seem be the problem.<\/p>\n

After searching way too long we found that .buildout\/default.cfg<\/code>\u00a0contains the following statement:<\/p>\n

allow-hosts =\n   *.python.org\n   *.gocept.com\n   *.gocept.net\n   effbot.org\n   dist.plone.org<\/pre>\n

It restricts the allowed hosts for download but it seems to restrict the index, too.\u00a0https:\/\/pypi.python.org\/simple<\/code>\u00a0nowadays redirects to\u00a0https:\/\/pypi.org\/simple<\/code> which is not on the list.<\/p>\n

Suggestion: Remove allow-hosts<\/code>\u00a0if possible. It is more harmful than good, especially because packages are nowadays downloaded from https:\/\/files.pythonhosted.org<\/code>.<\/p>\n

UPDATE:<\/strong><\/p>\n

I filed an issue for zc.buildout<\/code>\u00a0at GitHub:\u00a0buildout\/buildout#447<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

Today we had the following error message when re-installing a project from scratch: While: Installing. Getting section application. Initializing section application. Installing recipe zc.zope3recipes. Getting distribution for ‘zc.zope3recipes==0.13.0’. Error: Couldn’t find a distribution for ‘zc.zope3recipes==0.13.0’. Yes this is a really old recipe but it still exists on PyPI. We are using zc.buildout\u00a0in Version 2.10, and … Continue reading ““allow-hosts” in buildout considered harmful”<\/span><\/a><\/p>\n","protected":false},"author":15344399,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[10221],"tags":[1204731,8915,11869,6743072,832,23139133],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pFP3y-PV","jetpack-related-posts":[{"id":268,"url":"https:\/\/blog.gocept.com\/2012\/11\/09\/python-2-and-3-compatible-builds-with-zc-buildout\/","url_meta":{"origin":3219,"position":0},"title":"Python 2 and 3 compatible builds with zc.buildout","author":"","date":"November 9, 2012","format":false,"excerpt":"Creating a single-source build environment with zc.buildout that works for both Python 2 and 3 is a bit of a hassle. This blog post shows how to do it for a minimal demo project. During the sprints at PyCon DE 2012, we tried to make the upcoming 1.0 release of\u2026","rel":"","context":"In "en"","block_context":{"text":"en","link":"https:\/\/blog.gocept.com\/category\/en\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1361,"url":"https:\/\/blog.gocept.com\/2013\/08\/28\/run-tests-using-layers-with-py-test\/","url_meta":{"origin":3219,"position":1},"title":"Run tests using layers with py.test","author":"Michael Howitz","date":"August 28, 2013","format":false,"excerpt":"TL;DR Use gocept.pytestlayer. Long Story We have many test suites which use test layers (e. g. the ones from plone.testing). We want to use py.test\u00a0and all its fancy features to have a modern test runner. There was no way to convert such tests partly: either you have to port the\u2026","rel":"","context":"In "en"","block_context":{"text":"en","link":"https:\/\/blog.gocept.com\/category\/en\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1510,"url":"https:\/\/blog.gocept.com\/2015\/01\/19\/manage-javascript-dependencies-with-fanstatic\/","url_meta":{"origin":3219,"position":2},"title":"Manage JavaScript dependencies with Fanstatic","author":"","date":"January 19, 2015","format":false,"excerpt":"Until the beginning of this year, we were using Fanstatic to manage dependencies to external JavaScript libraries. In case you are not familiar with Fanstatic, here is a short overview. I will discuss benefits and drawbacks later on. How it works Imagine you want to use jQuery in one of\u2026","rel":"","context":"In "en"","block_context":{"text":"en","link":"https:\/\/blog.gocept.com\/category\/en\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":123,"url":"https:\/\/blog.gocept.com\/2011\/12\/06\/getting-sys-path-out-of-buildout\/","url_meta":{"origin":3219,"position":3},"title":"Getting sys.path out of buildout","author":"","date":"December 6, 2011","format":false,"excerpt":"A wrinkly part of buildout's design is that the PYTHONPATH is not easily available outside of scripts generated by buildout itself. I've been using the following workaround in some of my development tools for a while and found it quite helpful, even though it's hacky and rough around the edges:\u2026","rel":"","context":"In "en"","block_context":{"text":"en","link":"https:\/\/blog.gocept.com\/category\/en\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1525,"url":"https:\/\/blog.gocept.com\/2015\/03\/06\/manage-javascript-dependencies-with-bowerstatic\/","url_meta":{"origin":3219,"position":4},"title":"Manage JavaScript dependencies with BowerStatic","author":"","date":"March 6, 2015","format":false,"excerpt":"Last month I explained how to use Fanstatic to manage JS dependencies. Since we were more and more displeased by using Fanstatic, we recently switched to BowerStatic, the new kid on the block. Since the setup is a bit more complicated and you need more tools to have the same\u2026","rel":"","context":"In "en"","block_context":{"text":"en","link":"https:\/\/blog.gocept.com\/category\/en\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1262,"url":"https:\/\/blog.gocept.com\/2013\/04\/17\/running-tests-using-gocept-selenium-on-travis-ci\/","url_meta":{"origin":3219,"position":5},"title":"Running tests using gocept.selenium on Travis-CI","author":"Michael Howitz","date":"April 17, 2013","format":false,"excerpt":"Travis-CI\u00a0is a\u00a0free hosted continuous integration platform for the open source community. It has a good integration with Github, so each push to a project runs the tests \u00a0of the project. gocept.selenium\u00a0is a python package our company has developed as a test-friendly Python API for Selenium\u00a0which allows to run tests in\u2026","rel":"","context":"In "en"","block_context":{"text":"en","link":"https:\/\/blog.gocept.com\/category\/en\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/posts\/3219"}],"collection":[{"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/users\/15344399"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/comments?post=3219"}],"version-history":[{"count":5,"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/posts\/3219\/revisions"}],"predecessor-version":[{"id":3224,"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/posts\/3219\/revisions\/3224"}],"wp:attachment":[{"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/media?parent=3219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/categories?post=3219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/tags?post=3219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}