Skip to content

Commit

Permalink
Merge pull request #5 from joezuntz/version-flag
Browse files Browse the repository at this point in the history
Version flag
  • Loading branch information
joezuntz authored Mar 11, 2022
2 parents 193b1b2 + ea15303 commit 414d9f8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ jobs:
- name: Test with pytest
run: |
cosmosis --version
mkdir tmp && cd tmp && pytest --pyargs cosmosis
14 changes: 13 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,24 @@ jobs:
uses: actions/setup-python@v2

- name: Build wheel and source tarball
id: build_tarball
run: |
python setup.py sdist
version=$(head -1 cosmosis/version.py | cut -d "'" -f 2)
sha=$(shasum dist/cosmosis-${version}.tar.gz | awk '{print $1}')
echo "::set-output name=tarball-sha::${sha}"
echo "::set-output name=pypi-version::${version}"
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_COSMOSIS_UPLOAD }}

- name: Make PR on cosmosis conda forge feedstock
uses: joezuntz/cosmosis-action@v0.1
with:
token: ${{ secrets.PR_MAKER_TOKEN }}
which-repository: cosmosis
version: ${{ steps.build_tarball.outputs.pypi-version }}
hash: ${{ steps.build_tarball.outputs.tarball-sha }}
4 changes: 3 additions & 1 deletion cosmosis/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from .samplers.sampler import Sampler, ParallelSampler, Hints
from . import output as output_module
from .runtime.handler import activate_segfault_handling
from .version import __version__


RUNTIME_INI_SECTION = "runtime"
Expand Down Expand Up @@ -361,11 +362,12 @@ def main():
parser.add_argument("-v", "--variables", nargs="*", action=ParseExtraParameters, help="Override variables in values file, with format section.name1=value1 section.name2=value2...")
parser.add_argument("--only", nargs="*", help="Fix all parameters except the ones listed")
parser.add_argument("--graph", type=str, default='', help="Do not run a sampler; instead make a graphviz dot file of the pipeline")
parser.add_argument('--version', action='version', version=__version__, help="Print out a version number")
args = parser.parse_args(sys.argv[1:])

if args.graph:
make_graph(args.inifile, args.graph, args.params, args.variables)
return
return 0

demo_10_special (args)
demo_20b_special (args)
Expand Down
2 changes: 1 addition & 1 deletion cosmosis/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.5.17'
__version__ = '0.5.18'

0 comments on commit 414d9f8

Please sign in to comment.