Skip to content
Snippets Groups Projects
Commit 5ab97c59 authored by Jean-Baptiste Delisle's avatar Jean-Baptiste Delisle
Browse files

initial commit

parents
No related branches found
No related tags found
No related merge requests found
MANIFEST
dist/*
doc/build/*
doc/source/classes/*
*/__pycache__/*
*.egg-info
other/*
stages:
- build
- test
- staging
- production
Build distribution:
stage: build
before_script:
- export PATH=$PATH:/opt/anaconda3/bin/
- conda env create -f kepmodel_env.yml
- conda activate kepmodel
script:
- python setup.py sdist
after_script:
- conda deactivate
- conda env remove -n kepmodel
artifacts:
paths:
- dist/*.tar.gz
expire_in: 1 day
Run test:
stage: test
before_script:
- export PATH=$PATH:/opt/anaconda3/bin/
- conda env create -f kepmodel_env.yml
- conda activate kepmodel
script:
- pip install dist/*.tar.gz
- cd test
- python -m pytest
after_script:
- conda deactivate
- conda env remove -n kepmodel
Deploy on Staging:
stage: staging
script:
- cp dist/*.tar.gz /www/people/delisle/public/staging/kepmodel
Release and deploy on Production:
stage: production
before_script:
# According to documentation, gitlab uses detached HEAD and we need to go back to master to release.
# See https://gitlab.com/gitlab-org/gitlab-ce/issues/19421
- git checkout -B master origin/master
- git config --global user.name 'Gitlab CI'
- git config --global user.email ''
- git remote set-url origin "https://gitlab-ci-token:$RELEASE_TOKEN@gitlab.unige.ch/jean-baptiste.delisle/kepmodel.git"
script:
# Tag
- VERSION=`grep __version__ kepmodel/__info__.py | sed 's/.*version__ = "//' | sed 's/"//'`
- TAG_VERSION="v$VERSION"
- git tag -a "$TAG_VERSION" -m "Release kepmodel $TAG_VERSION"
- git push origin "$TAG_VERSION" --quiet
- CHANGES=`cat CHANGES.txt`
# Add release on gitlab (via gitlab API)
- curl -X POST -H "PRIVATE-TOKEN:$RELEASE_TOKEN" -F "name=Release kepmodel $TAG_VERSION" -F "tag_name=$TAG_VERSION" -F "ref=$TAG_VERSION" -F "description=Changes:$CHANGES" 'https://gitlab.unige.ch/api/v4/projects/2420/releases'
# Deploy on production
- cp dist/*.tar.gz /www/people/delisle/public/kepmodel
# Upgrade to next version
- MAJOR_DIGIT=`echo $VERSION | awk -F. '{print $1}'`
- MINOR_DIGIT=`echo $VERSION | awk -F. '{print $2}'`
- PATCH_DIGIT=`echo $VERSION | awk -F. '{print $3}'`
- PATCH_DIGIT=$((PATCH_DIGIT + 1))
- NEW_VERSION="$MAJOR_DIGIT.$MINOR_DIGIT.$PATCH_DIGIT"
- echo $NEW_VERSION
# Need to hack sed to work on both mac and unix. See details here : https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux
- sed -i.bak s"/version__ = \"$VERSION\"/version__ = \"$NEW_VERSION\"/g" kepmodel/__info__.py
- git add kepmodel/__info__.py
- git commit -m "Upgrade project to next version $NEW_VERSION"
- git push origin master --quiet
when: manual
This diff is collapsed.
graft kepmodel
kepmodel: Keplerian system model
================================
Read the documentation at `<https://obswww.unige.ch/~delisle/kepmodel/doc/>`_.
# -*- coding: utf-8 -*-
# Copyright 2021 Jean-Baptiste Delisle
#
# This file is part of kepmodel.
#
# kepmodel is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# kepmodel is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with kepmodel. If not, see <http://www.gnu.org/licenses/>.
__title__ = 'kepmodel'
__description__ = 'Keplerian system model.'
__author__ = 'Jean-Baptiste Delisle'
__author_email__ = 'jean-baptiste.delisle@unige.ch'
__license__ = 'GPLv3'
__url__ = 'https://gitlab.unige.ch/jean-baptiste.delisle/kepmodel'
__version__ = "0.1.0"
# -*- coding: utf-8 -*-
# Copyright 2021 Jean-Baptiste Delisle
#
# This file is part of kepmodel.
#
# kepmodel is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# kepmodel is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with kepmodel. If not, see <http://www.gnu.org/licenses/>.
from .__info__ import __version__
name: kepmodel
channels:
- conda-forge
dependencies:
- python>=3.6
- numpy>=1.12
- scipy>=1.2
- pytest
setup.py 0 → 100644
# -*- coding: utf-8 -*-
# Copyright 2021 Jean-Baptiste Delisle
#
# This file is part of kepmodel.
#
# kepmodel is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# kepmodel is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with kepmodel. If not, see <http://www.gnu.org/licenses/>.
from setuptools import setup
import os
path = os.path.abspath(os.path.dirname(__file__))
info = {}
with open(os.path.join(path, 'kepmodel', '__info__.py'), 'r') as f:
exec(f.read(), info)
setup(name=info['__title__'],
version=info['__version__'],
author=info['__author__'],
author_email=info['__author_email__'],
license=info['__license__'],
description=info['__description__'],
url=info['__url__'],
packages=['kepmodel'],
python_requires='>=3.6',
install_requires=[
'numpy>=1.16', 'scipy>=1.2', 'kepderiv>=0.2', 'spleaf>=0.2'
])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment