From f01763f28860c3046594fee5005793d39f53743d Mon Sep 17 00:00:00 2001 From: Joe Zuntz Date: Wed, 1 Jun 2022 14:36:06 +0100 Subject: [PATCH 1/2] remove "future" dependency --- cosmosis/main.py | 6 ++---- cosmosis/output/output_base.py | 1 - cosmosis/postprocessing/cosmology_theory_plots.py | 3 +-- cosmosis/postprocessing/postprocess_base.py | 3 +-- cosmosis/samplers/sampler.py | 5 ++--- setup.py | 1 - 6 files changed, 6 insertions(+), 13 deletions(-) diff --git a/cosmosis/main.py b/cosmosis/main.py index 0760d006..68d2fb75 100755 --- a/cosmosis/main.py +++ b/cosmosis/main.py @@ -44,11 +44,9 @@ def demo_10_special (args): print() print("There are two flavours of this demo, selected through an ") print("environment variable called `HALOFIT'; this variable is not ") - print("currently set, so we are giving it the value `halofit'.") - print("Please see the wiki for more information: ") - print("https://bitbucket.org/joezuntz/cosmosis/wiki/Demo10.") + print("currently set, so we are giving it the value `takahashi'.") - os.environ ["HALOFIT"] = "halofit" + os.environ ["HALOFIT"] = "takahashi" diff --git a/cosmosis/output/output_base.py b/cosmosis/output/output_base.py index 9a4ade21..73df278d 100644 --- a/cosmosis/output/output_base.py +++ b/cosmosis/output/output_base.py @@ -2,7 +2,6 @@ import logging import numpy as np import fcntl -from future.utils import with_metaclass import datetime import os diff --git a/cosmosis/postprocessing/cosmology_theory_plots.py b/cosmosis/postprocessing/cosmology_theory_plots.py index 28b38ae3..3e2923e1 100755 --- a/cosmosis/postprocessing/cosmology_theory_plots.py +++ b/cosmosis/postprocessing/cosmology_theory_plots.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -from future.utils import with_metaclass import os import argparse import numpy as np @@ -44,7 +43,7 @@ def __new__(meta, name, bases, class_dict): meta.registry -= set(bases) return cls -class Plot(with_metaclass(RegisteredPlot, object)): +class Plot(metaclass=RegisteredPlot): #Subclasses should override this to specify the base #part of their filename filename = "error" diff --git a/cosmosis/postprocessing/postprocess_base.py b/cosmosis/postprocessing/postprocess_base.py index 73f5c6b0..fc06f91a 100644 --- a/cosmosis/postprocessing/postprocess_base.py +++ b/cosmosis/postprocessing/postprocess_base.py @@ -7,7 +7,6 @@ from ..runtime.config import Inifile import imp import os -from future.utils import with_metaclass postprocessor_registry = {} from io import StringIO @@ -20,7 +19,7 @@ def __init__(cls, name, b, d): if d is None: return postprocessor_registry[sampler] = cls -class PostProcessor(with_metaclass(PostProcessMetaclass, object)): +class PostProcessor(metaclass=PostProcessMetaclass): sampler=None cosmosis_standard_output=True def __init__(self, ini, label, index, **options): diff --git a/cosmosis/samplers/sampler.py b/cosmosis/samplers/sampler.py index a434ae6e..29ea85c8 100644 --- a/cosmosis/samplers/sampler.py +++ b/cosmosis/samplers/sampler.py @@ -1,4 +1,3 @@ -from future.utils import with_metaclass from ..runtime.attribution import PipelineAttribution from ..runtime.utils import get_git_revision from ..runtime import Inifile @@ -30,7 +29,7 @@ def __new__(meta, name, bases, class_dict): else: raise ValueError("Sampler classes must be named [Name]Sampler") -class Sampler(with_metaclass(RegisteredSampler, object)): +class Sampler(metaclass=RegisteredSampler): needs_output = True sampler_outputs = [] understands_fast_subspaces = False @@ -86,7 +85,7 @@ def collect_run_metadata(self): if save_username: info['hostname'] = platform.node() info['username'] = getpass.getuser() - + info['workdir'] = os.getcwd() return info diff --git a/setup.py b/setup.py index b88fb53d..1b49d552 100644 --- a/setup.py +++ b/setup.py @@ -172,7 +172,6 @@ def run(self): requirements = [ "pyyaml", - "future", "emcee", "numpy", "scipy", From 56644668f486f38479c7276e84c438cce013fefa Mon Sep 17 00:00:00 2001 From: Joe Zuntz Date: Wed, 1 Jun 2022 14:48:26 +0100 Subject: [PATCH 2/2] update to new conda forge action --- .github/workflows/publish.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 34e7ca3f..1b32ed06 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -31,9 +31,11 @@ jobs: password: ${{ secrets.PYPI_COSMOSIS_UPLOAD }} - name: Make PR on cosmosis conda forge feedstock - uses: joezuntz/cosmosis-action@v0.3 + uses: joezuntz/conda-forge-feedstock-pr-action@v0.6 with: + feedstock_name: cosmosis token: ${{ secrets.PR_MAKER_TOKEN }} - which-repository: cosmosis version: ${{ steps.build_tarball.outputs.pypi-version }} hash: ${{ steps.build_tarball.outputs.tarball-sha }} + fork_owner: joezuntz + email_address: joezuntz@googlemail.com