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

Automatically initialize asdf-standard submodule in setup.py #398

Merged
merged 3 commits into from
Nov 27, 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
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

- Install and load extensions using ``setuptools`` entry points. [#384]

- Automatically initialize ``asdf-standard`` submodule in ``setup.py``. [#398]

1.3.2 (unreleased)
------------------

Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ matrix:
install:
- "git clone git://github.com/astropy/ci-helpers.git"
- "powershell ci-helpers/appveyor/install-miniconda.ps1"
- "git submodule update --init asdf-standard"
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- "activate test"
- "%CMD_IN_ENV% python -m pip install --no-deps %GWCS_GIT%"
Expand Down
10 changes: 8 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import glob
import os
import sys
import subprocess as sp

import ah_bootstrap
from setuptools import setup
Expand Down Expand Up @@ -91,8 +92,13 @@ def _null_validate(self):
package_info['packages'].append('asdf.schemas')

# The reference files come from a git submodule, so we deal with them here
reference_file_root = os.path.join(
ASDF_STANDARD_ROOT, "reference_files")
reference_file_root = os.path.join(ASDF_STANDARD_ROOT, "reference_files")
if not os.path.exists(reference_file_root):
ret = sp.call(['git', 'submodule', 'update', '--init', ASDF_STANDARD_ROOT])
if ret != 0 or not os.path.exists(reference_file_root):
sys.stderr.write("Failed to initialize 'asdf-standard' submodule\n")
sys.exit(ret or 1)

package_info['package_dir']['asdf.reference_files'] = reference_file_root
for dirname in os.listdir(reference_file_root):
package_info['package_dir']['asdf.reference_files.' + dirname] = os.path.join(
Expand Down