payload: {"action":"opened","number":8402,"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/8402","id":251074413,"node_id":"MDExOlB1bGxSZXF1ZXN0MjUxMDc0NDEz","html_url":"https://github.com/astropy/astropy/pull/8402","diff_url":"https://github.com/astropy/astropy/pull/8402.diff","patch_url":"https://github.com/astropy/astropy/pull/8402.patch","issue_url":"https://api.github.com/repos/astropy/astropy/issues/8402","number":8402,"state":"open","locked":false,"title":"Don't require astropy to be importable at setup.py time","user":{"login":"astrofrog","id":314716,"node_id":"MDQ6VXNlcjMxNDcxNg==","avatar_url":"https://avatars2.githubusercontent.com/u/314716?v=4","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"body":"One of my missions currently is to try and reduce the complexity of the very idiosyncratic infrastructure that we've accumulated over the lifetime of the project. One of these in particular is the fact that until now packages have had to be importable at setup.py time *even if they contain C extensions*, which requires the convoluted approach of defining the ``__ASTROPY_SETUP__`` builtin and making sure that every single C extension we import is conditional on this variable.\r\n\r\nIn the past, the reason why astropy needed to be importable is because astropy-helpers and the ``setup_package.py`` files tried to import ``astropy.version`` at various points in the process, though this then grew to include other files. After a series of pull requests in recent weeks, astropy-helpers should now no longer import the whole package (although packages might still do this to themselves) - instead if it really needs to access the version, then for now it uses the ``import_file`` function which allows us to import specific files without importing the whole package. This PR now extends this kind of work to the core package to make sure that when we do need to import other files during the setup process, we use ``import_file`` rather than importing e.g. ``astropy.version`` directly.\r\n\r\nI should note the following changes in particular:\r\n\r\n* For the WCS module, I had to rearrange one of the files to facilitate this approach, but overall this doesn't require too many changes, mostly just combining two files.\r\n\r\n* We formerly imported astropy in the setup.py file to get ``__minimum_numpy_version__``, but this PR changes that to define the numpy requirement properly in setup.cfg. This does mean duplication for now, but I would argue that since we define the requirement properly in setup.cfg/setup.py, we should consider getting rid of the definition of ``__minimum_numpy_version__`` and the check for the numpy version in ``astropy/__init__.py``, since that is no longer really necessary (when astropy is installed with pip or conda, a compatible version of numpy will be installed)\r\n\r\n* Currently I raise an exception in ``astropy/__init__.py`` if astropy is imported during the setup process. I had intended for that to just be a temporary thing to make sure this all works properly, but it might actually just make sense to keep it to prevent regressions.","created_at":"2019-02-07T11:11:18Z","updated_at":"2019-02-07T11:11:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":316473427,"node_id":"MDU6TGFiZWwzMTY0NzM0Mjc=","url":"https://api.github.com/repos/astropy/astropy/labels/Refactoring","name":"Refactoring","color":"fef2c0","default":false},{"id":375279796,"node_id":"MDU6TGFiZWwzNzUyNzk3OTY=","url":"https://api.github.com/repos/astropy/astropy/labels/no-changelog-entry-needed","name":"no-changelog-entry-needed","color":"c2e0c6","default":false}],"milestone":{"url":"https://api.github.com/repos/astropy/astropy/milestones/65","html_url":"https://github.com/astropy/astropy/milestone/65","labels_url":"https://api.github.com/repos/astropy/astropy/milestones/65/labels","id":3667043,"node_id":"MDk6TWlsZXN0b25lMzY2NzA0Mw==","number":65,"title":"v3.2","description":"","creator":{"login":"eteq","id":346587,"node_id":"MDQ6VXNlcjM0NjU4Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/346587?v=4","gravatar_id":"","url":"https://api.github.com/users/eteq","html_url":"https://github.com/eteq","followers_url":"https://api.github.com/users/eteq/followers","following_url":"https://api.github.com/users/eteq/following{/other_user}","gists_url":"https://api.github.com/users/eteq/gists{/gist_id}","starred_url":"https://api.github.com/users/eteq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eteq/subscriptions","organizations_url":"https://api.github.com/users/eteq/orgs","repos_url":"https://api.github.com/users/eteq/repos","events_url":"https://api.github.com/users/eteq/events{/privacy}","received_events_url":"https://api.github.com/users/eteq/received_events","type":"User","site_admin":false},"open_issues":49,"closed_issues":35,"state":"open","created_at":"2018-09-18T17:36:59Z","updated_at":"2019-02-07T11:11:18Z","due_on":"2019-04-19T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/astropy/astropy/pulls/8402/commits","review_comments_url":"https://api.github.com/repos/astropy/astropy/pulls/8402/comments","review_comment_url":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/8402/comments","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/c965aa4bba5ab9346a09d2726ce882711d1438ab","head":{"label":"astrofrog:no-require-import-setup","ref":"no-require-import-setup","sha":"c965aa4bba5ab9346a09d2726ce882711d1438ab","user":{"login":"astrofrog","id":314716,"node_id":"MDQ6VXNlcjMxNDcxNg==","avatar_url":"https://avatars2.githubusercontent.com/u/314716?v=4","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"repo":{"id":2576841,"node_id":"MDEwOlJlcG9zaXRvcnkyNTc2ODQx","name":"astropy","full_name":"astrofrog/astropy","private":false,"owner":{"login":"astrofrog","id":314716,"node_id":"MDQ6VXNlcjMxNDcxNg==","avatar_url":"https://avatars2.githubusercontent.com/u/314716?v=4","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"html_url":"https://github.com/astrofrog/astropy","description":"Main AstroPy repository","fork":true,"url":"https://api.github.com/repos/astrofrog/astropy","forks_url":"https://api.github.com/repos/astrofrog/astropy/forks","keys_url":"https://api.github.com/repos/astrofrog/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astrofrog/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astrofrog/astropy/teams","hooks_url":"https://api.github.com/repos/astrofrog/astropy/hooks","issue_events_url":"https://api.github.com/repos/astrofrog/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/astrofrog/astropy/events","assignees_url":"https://api.github.com/repos/astrofrog/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/astrofrog/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/astrofrog/astropy/tags","blobs_url":"https://api.github.com/repos/astrofrog/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astrofrog/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astrofrog/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/astrofrog/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astrofrog/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/astrofrog/astropy/languages","stargazers_url":"https://api.github.com/repos/astrofrog/astropy/stargazers","contributors_url":"https://api.github.com/repos/astrofrog/astropy/contributors","subscribers_url":"https://api.github.com/repos/astrofrog/astropy/subscribers","subscription_url":"https://api.github.com/repos/astrofrog/astropy/subscription","commits_url":"https://api.github.com/repos/astrofrog/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/astrofrog/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/astrofrog/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/astrofrog/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/astrofrog/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/astrofrog/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astrofrog/astropy/merges","archive_url":"https://api.github.com/repos/astrofrog/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astrofrog/astropy/downloads","issues_url":"https://api.github.com/repos/astrofrog/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/astrofrog/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/astrofrog/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/astrofrog/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astrofrog/astropy/labels{/name}","releases_url":"https://api.github.com/repos/astrofrog/astropy/releases{/id}","deployments_url":"https://api.github.com/repos/astrofrog/astropy/deployments","created_at":"2011-10-14T14:58:26Z","updated_at":"2019-02-07T10:36:02Z","pushed_at":"2019-02-07T10:50:18Z","git_url":"git://github.com/astrofrog/astropy.git","ssh_url":"git@github.com:astrofrog/astropy.git","clone_url":"https://github.com/astrofrog/astropy.git","svn_url":"https://github.com/astrofrog/astropy","homepage":"astropy.org","size":73355,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":2,"watchers":4,"default_branch":"master"}},"base":{"label":"astropy:master","ref":"master","sha":"576b4a15bc1d4e270b32444b386bbd81a37921c7","user":{"login":"astropy","id":847984,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0Nzk4NA==","avatar_url":"https://avatars0.githubusercontent.com/u/847984?v=4","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"repo":{"id":2081289,"node_id":"MDEwOlJlcG9zaXRvcnkyMDgxMjg5","name":"astropy","full_name":"astropy/astropy","private":false,"owner":{"login":"astropy","id":847984,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0Nzk4NA==","avatar_url":"https://avatars0.githubusercontent.com/u/847984?v=4","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/astropy/astropy","description":"Repository for the Astropy core package","fork":false,"url":"https://api.github.com/repos/astropy/astropy","forks_url":"https://api.github.com/repos/astropy/astropy/forks","keys_url":"https://api.github.com/repos/astropy/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astropy/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astropy/astropy/teams","hooks_url":"https://api.github.com/repos/astropy/astropy/hooks","issue_events_url":"https://api.github.com/repos/astropy/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/astropy/astropy/events","assignees_url":"https://api.github.com/repos/astropy/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/astropy/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/astropy/astropy/tags","blobs_url":"https://api.github.com/repos/astropy/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astropy/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astropy/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/astropy/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/astropy/astropy/languages","stargazers_url":"https://api.github.com/repos/astropy/astropy/stargazers","contributors_url":"https://api.github.com/repos/astropy/astropy/contributors","subscribers_url":"https://api.github.com/repos/astropy/astropy/subscribers","subscription_url":"https://api.github.com/repos/astropy/astropy/subscription","commits_url":"https://api.github.com/repos/astropy/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/astropy/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/astropy/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/astropy/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/astropy/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/astropy/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astropy/astropy/merges","archive_url":"https://api.github.com/repos/astropy/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astropy/astropy/downloads","issues_url":"https://api.github.com/repos/astropy/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/astropy/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/astropy/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/astropy/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astropy/astropy/labels{/name}","releases_url":"https://api.github.com/repos/astropy/astropy/releases{/id}","deployments_url":"https://api.github.com/repos/astropy/astropy/deployments","created_at":"2011-07-21T01:33:49Z","updated_at":"2019-02-07T09:47:03Z","pushed_at":"2019-02-07T10:56:56Z","git_url":"git://github.com/astropy/astropy.git","ssh_url":"git@github.com:astropy/astropy.git","clone_url":"https://github.com/astropy/astropy.git","svn_url":"https://github.com/astropy/astropy","homepage":"www.astropy.org","size":78175,"stargazers_count":1989,"watchers_count":1989,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1017,"mirror_url":null,"archived":false,"open_issues_count":978,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":1017,"open_issues":978,"watchers":1989,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/8402"},"html":{"href":"https://github.com/astropy/astropy/pull/8402"},"issue":{"href":"https://api.github.com/repos/astropy/astropy/issues/8402"},"comments":{"href":"https://api.github.com/repos/astropy/astropy/issues/8402/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/astropy/pulls/8402/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/astropy/pulls/8402/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/astropy/statuses/c965aa4bba5ab9346a09d2726ce882711d1438ab"}},"author_association":"MEMBER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":9,"additions":141,"deletions":192,"changed_files":15}}
other: {"actor":{"display_login":"astrofrog"}}