Skip to content

Commit

Permalink
Automatically create release archive
Browse files Browse the repository at this point in the history
  • Loading branch information
ajtribick committed Oct 2, 2020
1 parent 8a9ae98 commit 8e79d3a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ vizier
xmatch
*.kate-swp
*.pyc
/celestia*.zip
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ good-names=f,
ra,
rv,
tf,
zf,
Run,
_

Expand Down
11 changes: 11 additions & 0 deletions make_stardb.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import tarfile
import warnings

from zipfile import ZipFile, ZIP_DEFLATED

import numpy as np
import astropy.io.ascii as io_ascii
import astropy.units as u
Expand All @@ -37,6 +39,8 @@
from parse_tyc import process_tyc
from spparse import CEL_UNKNOWN_STAR, parse_spectrum_vec

VERSION = "1.0.2"

# remove the following objects from the output

EXCLUSIONS = [
Expand Down Expand Up @@ -310,5 +314,12 @@ def make_stardb() -> None:
for fieldname, outfile in xindices:
write_xindex(data, fieldname, os.path.join('output', outfile))

print("Creating archive")
archivename = f'celestia-gaia-stardb-{VERSION}'
with ZipFile(f'{archivename}.zip', 'w', compression=ZIP_DEFLATED, compresslevel=9) as zf:
contents = ['stars.dat', 'hdxindex.dat', 'saoxindex.dat', 'LICENSE.txt', 'CREDITS.md']
for f in contents:
zf.write(os.path.join('output', f), arcname=os.path.join(archivename, f))

if __name__ == '__main__':
make_stardb()

0 comments on commit 8e79d3a

Please sign in to comment.