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

streamlines sdss_install_bootstrap and configuration #48

Open
wants to merge 69 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
5ed430d
adding bash configure script to aid in initial setup of sdss_install;…
havok2063 Nov 19, 2019
108ffa3
formatting files for better readability
havok2063 Nov 19, 2019
a664cf7
adding tests; set-dir-install now uses sub-roots
havok2063 Nov 21, 2019
8c598da
expanding test suite; adding option to skip git version subdirectorie…
havok2063 Nov 21, 2019
28feff6
expanding module tests
havok2063 Nov 21, 2019
3302270
allowed specification of different module paths; adding tests
havok2063 Nov 22, 2019
dcfb745
updating logger to fix warning_registry bug; adding build test
havok2063 Nov 22, 2019
1981f2c
adding tests for bootstrap; tweaking paths for bootstrap
havok2063 Nov 22, 2019
2c546fb
adding tests; removing version in modulefile when skip-git-verdirs set
havok2063 Nov 25, 2019
a1c7c27
updating travis config to build branches
havok2063 Nov 25, 2019
e84b541
updating tests to handle latest tag for sdss_install bootstrap
havok2063 Nov 25, 2019
92890fc
adding public test; adding skip for private svn tests
havok2063 Nov 26, 2019
1fe1aac
updating changelog with some initial entries
havok2063 Nov 26, 2019
2559db9
synchronized package version with tag versions
havok2063 Nov 26, 2019
a42b0da
setting travis to only run public svn tests
havok2063 Nov 26, 2019
9ca8e79
adding py2.7 as travis allowed failure; updating git subprocess comma…
havok2063 Nov 26, 2019
798e9ef
testing git fetch unshallow for travis
havok2063 Nov 26, 2019
fd58370
test of setting tests to use public http git url
havok2063 Nov 26, 2019
121b021
test of setting tests to use public http git remote url
havok2063 Nov 26, 2019
bbcb663
test installing lmod for travis ci
havok2063 Nov 26, 2019
bdc7f8e
testing setup of lmod on travis
havok2063 Nov 26, 2019
2e726ab
testing setup of lmod on travis
havok2063 Nov 26, 2019
1772e07
fixing bootstrap test for travis
havok2063 Nov 26, 2019
ff88d63
fixing bootstrap test for travis
havok2063 Nov 26, 2019
0db2864
fixing tests for py3.5
havok2063 Nov 26, 2019
c7a2ae2
updating changelog
havok2063 Nov 26, 2019
807574e
adding option in bootstrap to skip git version for sdss_install
havok2063 Nov 26, 2019
1ccea71
adding option in bootstrap to skip git version for sdss_install
havok2063 Nov 26, 2019
99e43f9
merging latest master
havok2063 Feb 24, 2020
70ad265
updating changelog with new version
havok2063 Feb 24, 2020
f14e344
Bump version: 1.0.6dev → 1.0.7dev
havok2063 Feb 24, 2020
1a1e92c
removing duplicate method in Install class
havok2063 Feb 24, 2020
ff56c22
removing explicit use/save of temporary SDSS_INSTALL_DIR
havok2063 Feb 24, 2020
03fdfdf
modifying bootstrap step so sdss_install installs a fresh proper sdss…
havok2063 Feb 24, 2020
a77d2f4
renaming sdss_install error classes
havok2063 Feb 25, 2020
2e983fc
cleaning up imports and linting
havok2063 Feb 25, 2020
d0409a9
sorting some imports
havok2063 Feb 25, 2020
d5b443f
fixing try except
havok2063 Feb 25, 2020
fc8d34c
cleaning up files
havok2063 Feb 25, 2020
7d5c942
fixing try except
havok2063 Feb 25, 2020
f1b5f09
adding module method for listing currently loaded modules
havok2063 Feb 25, 2020
bf11f70
adding new file for module tests
havok2063 Feb 25, 2020
f943310
adding new file for module tests
havok2063 Feb 25, 2020
30e801a
adding some instructional text to configure script
havok2063 Feb 26, 2020
91f01d5
adding installation completion text
havok2063 Feb 27, 2020
7c7b1c3
adding install complete message; bootstrap now uses force option when…
havok2063 Feb 27, 2020
9bb5d79
adding new documentation for installation and use of sdss_install
havok2063 Feb 27, 2020
d7764a9
bugfix in bootstrap
havok2063 Feb 27, 2020
d14fc44
adding missing mkdir step in configure
havok2063 Feb 27, 2020
60c7cb6
adding small description to docs for new test
havok2063 Feb 28, 2020
b2d803d
trying to fix module test
havok2063 Feb 28, 2020
ed9600b
trying to fix module test
havok2063 Feb 28, 2020
5c884d3
trying to fix module test
havok2063 Feb 28, 2020
0fb661c
trying to skip module test for travis
havok2063 Feb 28, 2020
ab80f7e
doc tweak
havok2063 Feb 28, 2020
88aacf1
updating the changelog to releases
havok2063 Feb 29, 2020
4e98017
Bump version: 1.0.7dev → 1.1.0dev
havok2063 Feb 29, 2020
494fe60
testing travis build on osx
havok2063 May 11, 2020
9dc8111
testing travis build on osx
havok2063 May 11, 2020
25dde80
testing travis build on osx
havok2063 May 11, 2020
837169e
tweaking travis config
havok2063 May 11, 2020
73b0a4e
tweaking travis config
havok2063 May 11, 2020
7c0b79b
bug fix travis.yml
havok2063 May 11, 2020
55dc2e5
tweaking travis
havok2063 May 11, 2020
87a9388
tweaking travis
havok2063 May 11, 2020
e887b50
removing tree and sdss_access requirements
havok2063 May 12, 2020
d13f92a
adding some docs on testing; trying matrix os
havok2063 May 12, 2020
6d949db
tweaking travis
havok2063 May 12, 2020
6ef6a45
updating test docs
havok2063 May 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.2dev
current_version = 1.1.0dev
commit = True
tag = False
tag_name = {new_version}
Expand Down
49 changes: 37 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,62 @@ cache:
pip: true
timeout: 1000

sudo: false

python:
- '2.7'
- '3.5'
- '3.6'
- '3.7'

os:
- linux

matrix:
jobs:
fast_finish: true
allow_failures:
- python: '2.7'
- os: osx
include:
- name: "Python 3.7 on macOS"
os: osx
osx_image:
- xcode11.2 # Python 3.7.7 running on macOS 10.14.6
language: shell # 'language: python' is an error on Travis CI macOS
- name: "Python 3.6 on macOS"
os: osx
osx_image:
- xcode9.4 # Python 3.6.5 running on macOS 10.13
language: shell

notifications:
email: false

# repo branches to test
branches:
- master
only:
- /.*/

before_install:
# installing lmod modules on linux
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -y ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install -y lmod; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then source /usr/share/lmod/lmod/init/profile; fi
# installing lmod modules on osx
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install lmod ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then source /usr/local/opt/lmod/init/profile; fi


install:
- pip install -U pip wheel --quiet
- pip install --upgrade setuptools --quiet
- pip install -r requirements.txt --quiet
- pip install pytest
- pip install pytest-coverage
- pip install coveralls
#- python setup.py install
- pip3 install -U pip wheel --quiet
- pip3 install --upgrade setuptools --quiet
- pip3 install -r requirements.txt --quiet
- pip3 install pytest
- pip3 install pytest-coverage
- pip3 install coveralls
#- python setup.py install

script:
- pytest python/sdss_install/tests --cov python/sdss_install --cov-report html
- pytest --public-svn-only python/sdss_install/tests --cov python/sdss_install --cov-report html

after_success:
- coveralls
72 changes: 40 additions & 32 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
.. _sdss_install-changelog:

==========
Change Log
==========

This document records the main changes to the sdss_install code.

.. _changelog-0.1.0:
0.1.0 (unreleased)
------------------

Added
^^^^^
* A thing we added.

.. x.y.z (unreleased)
.. ------------------
..
.. A short description
..
.. Added
.. ^^^^^
.. * TBD
..
.. Changed
.. ^^^^^^^
.. * TBD
..
.. Fixed
.. ^^^^^
.. * TBD

Changelog
=========

This document records the main changes to the ``sdss_install`` code.

* :release:`1.1.0 <unreleased>`
* :support:`7` Added sphinx documentation for readthedocs
* :feature:`48` new ``--github-url`` option to optionally set a different public git url
* :support:`48` Updated changelog
* :feature:`12` Added new configuration bash sript to aid setup during sdss_install bootstrap
* :feature:`12` Added new environment variables to customize GIT and SVN product and modulefile locations
* :feature:`48` Use of custom `sdss_install.yml` config file for loading of parameters and environment variables
* :feature:`45` New ``--skip-git-verdirs`` option to turn off use of version sub-directories for git repos
* :support:`48` Initial test suite for better failure tracking and robustness
* :support:`48` Set up testing on Travis-CI
* :bug:`48 major` synchronized package version with tag versions

* :release:`1.0.6 <2019-12-09>`
* :feature:`47` Added new command line option ``--https`` enables the user to use sdss_install with either https or ssh.
* :bug:`46` - no option for git install from https

* :release:`1.0.5 <2019-11-13>`
* :feature:`39 backported` Added support for installation of external dependencies

* :release:`1.0.4 <2019-07-02>`
* :feature:`42 backported` Added new ``sdss_install_version`` script to check version of the currently checked out Git branch or tag.
* :feature:`25 backported` Added support for Mac Brew installed modules

* :release:`1.0.3 <2019-05-16>`
* :feature:`- backported` Added custom `Module(s)` class for improved system handling of module files

* :release:`1.0.2 <2019-05-13>`
* :feature:`- backported` Implemented subprocessing of git commands for version validation
* :feature:`29 backported` Grab latest tag of sdss_install during install for robustness
* :bug:`21` Removed GraphQL implementation of version validation

* :release:`1.0.1 <2019-05-13>`
* :feature:`-` Initial release of `sdss_install`
* :feature:`-` GraphQL product/version validation of Github repos
74 changes: 74 additions & 0 deletions bin/add_to_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Filename: add_to_config.py
# Project: bin
# Author: Brian Cherinka
# Created: Monday, 18th November 2019 6:12:06 pm
# License: BSD 3-clause "New" or "Revised" License
# Copyright (c) 2019 Brian Cherinka
# Last Modified: Monday, 18th November 2019 6:57:04 pm
# Modified By: Brian Cherinka


from __future__ import print_function, division, absolute_import

import os
import sys
import yaml
import argparse


def update_config(envvars):
''' Update the custom config with environment variables '''
data = {row[0]: row[1] for row in envvars}

custom_config_fn = os.path.expanduser('~/.{0}/{0}.yml'.format('sdss_install'))

if os.path.exists(custom_config_fn):
config = yaml.load(open(custom_config_fn), Loader=yaml.SafeLoader)

# add the environment variables
if 'envs' in config:
config['envs'].update(data)
else:
config['envs'] = data

# append to the file
with open(custom_config_fn, 'w+') as file:
yaml.dump(config, file)
else:
# write a new custom config
dirname = os.path.dirname(custom_config_fn)
if not os.path.exists(dirname):
os.makedirs(dirname)
with open(custom_config_fn, 'w') as file:
yaml.dump({'envs': data}, file)


def parse_args():
''' Parse the arguments '''

parser = argparse.ArgumentParser(
prog='update your custom sdss_install.yaml config file', usage='%(prog)s [opts]')
parser.add_argument('-v', '--verbose', action='store_true', dest='verbose',
help='Print extra information.', default=False)
parser.add_argument('-e', "--envvars", nargs='*',
type=lambda kv: kv.split("="), dest='envvars',
help='The environment variables to add to the config file; as key-value pairs')
opts = parser.parse_args()

return opts


def main(args):

# parse arguments
opts = parse_args()

# write to config
update_config(opts.envvars)


if __name__ == '__main__':
main(sys.argv[1:])