From d6d73c3522e441789b4b24236d6080fe52cd97a8 Mon Sep 17 00:00:00 2001 From: TjarkMiener Date: Mon, 3 Jun 2024 14:04:55 +0200 Subject: [PATCH 1/3] revert version.py --- ctlearn/version.py | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/ctlearn/version.py b/ctlearn/version.py index 4e58917e..6184a328 100644 --- a/ctlearn/version.py +++ b/ctlearn/version.py @@ -27,7 +27,7 @@ but being much more lightwheight """ -from subprocess import check_output, CalledProcessError, run, PIPE +from subprocess import check_output, CalledProcessError from os import path, name, devnull, environ, listdir from ast import literal_eval @@ -78,36 +78,23 @@ def find_git_on_windows(): GIT_COMMAND = find_git_on_windows() -def get_current_version(): - """ - Given a repository, list all tags for that repository - without cloning it and get the current version. - """ - result = run([ - "git", "ls-remote", "--tags" - ], stdout= PIPE, text=True) - - output_lines = result.stdout.splitlines() - - tags = [ - line.split("refs/tags/")[-1] for line in output_lines - if "refs/tags/" in line and "^{}" not in line - - ] - last_tag = tags[-1][1:] - return last_tag - - def get_git_describe_version(abbrev=7): """return the string output of git desribe""" try: - return get_current_version() + with open(devnull, "w") as fnull: + arguments = [GIT_COMMAND, "describe", "--tags", "--abbrev=%d" % abbrev] + return ( + check_output(arguments, cwd=CURRENT_DIRECTORY, stderr=fnull) + .decode("ascii") + .strip() + ) except (OSError, CalledProcessError): return None def format_git_describe(git_str, pep440=False): """format the result of calling 'git describe' as a python version""" + if "-" not in git_str: # currently at a tag formatted_str = git_str else: @@ -171,9 +158,11 @@ def get_version(pep440=False): The file VERSION will need to be changed manually. """ + raw_git_version = get_git_describe_version() if not raw_git_version: # not a git repository return read_release_version() + git_version = format_git_describe(raw_git_version, pep440=pep440) return git_version From ffd7a7e2a429f56f4a4b53a96cfeea0328f387a3 Mon Sep 17 00:00:00 2001 From: TjarkMiener Date: Mon, 3 Jun 2024 14:18:25 +0200 Subject: [PATCH 2/3] update dl1dh version --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 4f2c30d0..5df78b8c 100644 --- a/environment.yml +++ b/environment.yml @@ -7,7 +7,7 @@ channels: - ctlearn-project dependencies: - python=3.10 - - dl1_data_handler==0.10.10 + - dl1_data_handler==0.11.1 - astropy - matplotlib - numpy From 08a4327ee332175f142a5dc3ebdd3d5db597fd3d Mon Sep 17 00:00:00 2001 From: TjarkMiener Date: Mon, 3 Jun 2024 14:27:51 +0200 Subject: [PATCH 3/3] prep for v0.8.0 --- README.rst | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/README.rst b/README.rst index df34a535..8f4be2fa 100644 --- a/README.rst +++ b/README.rst @@ -37,7 +37,7 @@ necessary package channels, and install CTLearn specified version and its depend .. code-block:: bash - CTLEARN_VER=0.7.0 + CTLEARN_VER=0.8.0 wget https://raw.githubusercontent.com/ctlearn-project/ctlearn/v$CTLEARN_VER/environment.yml conda env create -n [ENVIRONMENT_NAME] -f environment.yml conda activate [ENVIRONMENT_NAME] @@ -54,29 +54,10 @@ Citing this software Please cite the corresponding version using the DOIs below if this software package is used to produce results for any publication: -.. |zendoi060| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.6842323.svg - :target: https://doi.org/10.5281/zenodo.6842323 -.. |zendoi052| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.5947837.svg - :target: https://doi.org/10.5281/zenodo.5947837 -.. |zendoi051| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.5772815.svg - :target: https://doi.org/10.5281/zenodo.5772815 -.. |zendoi050| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4576196.svg - :target: https://doi.org/10.5281/zenodo.4576196 -.. |zendoi040| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3345947.svg - :target: https://doi.org/10.5281/zenodo.3345947 -.. |zendoi040l| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3342954.svg - :target: https://doi.org/10.5281/zenodo.3342954 -.. |zendoi031| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3342953.svg - :target: https://doi.org/10.5281/zenodo.3342953 - - -* 0.6.0 : |zendoi050| -* 0.5.2 : |zendoi050| -* 0.5.1 : |zendoi050| -* 0.5.0 : |zendoi050| -* 0.4.0 : |zendoi040| -* 0.4.0-legacy : |zendoi040l| -* 0.3.1 : |zendoi031| +.. |zendoi070| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.7908252.svg + :target: https://doi.org/10.5281/zenodo.7908252 + +* 0.7.0 : |zendoi070| Team ----