From ae229bc53fdc55aa5828ea1334bb4144d132d0ff Mon Sep 17 00:00:00 2001 From: regro-cf-autotick-bot <36490558+regro-cf-autotick-bot@users.noreply.github.com> Date: Mon, 4 Jan 2021 12:11:18 +0000 Subject: [PATCH 1/2] updated v0.4.3 --- recipe/meta.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index dc61bd5..84b8c1a 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,18 +1,18 @@ {% set name = "fredapi" %} -{% set version = "0.4.2" %} +{% set version = "0.4.3" %} package: - name: "{{ name|lower }}" - version: "{{ version }}" + name: {{ name|lower }} + version: {{ version }} source: url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz - sha256: 753eb21fd75b461d36177eb9da298d1e0ec3ccfd4f64e13e74ffc216a89a2b96 + sha256: d9b3194fb60541991bd33f019c710d4a9580ecfb5e47efbf2d2571888a2aac02 build: number: 0 noarch: python - script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv " + script: '{{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv ' requirements: host: From 0b274d10d6bd82c432460783feba900acc2540ad Mon Sep 17 00:00:00 2001 From: regro-cf-autotick-bot <36490558+regro-cf-autotick-bot@users.noreply.github.com> Date: Mon, 4 Jan 2021 12:11:24 +0000 Subject: [PATCH 2/2] MNT: Re-rendered with conda-build 3.20.5, conda-smithy 3.8.6, and conda-forge-pinning 2021.01.03.16.11.28 --- .azure-pipelines/azure-pipelines-linux.yml | 27 ++++--- .azure-pipelines/build_steps.sh | 38 ---------- .ci_support/{linux_.yaml => linux_64_.yaml} | 8 +- .gitattributes | 18 +++++ .github/CODEOWNERS | 1 + .github/CONTRIBUTING.md | 15 ---- .github/ISSUE_TEMPLATE.md | 25 ------- .github/PULL_REQUEST_TEMPLATE.md | 18 ----- .scripts/build_steps.sh | 53 +++++++++++++ .../run_docker_build.sh | 52 ++++++++++--- LICENSE.txt | 2 +- README.md | 13 ++-- build-locally.py | 75 +++++++++++++++++++ 13 files changed, 218 insertions(+), 127 deletions(-) delete mode 100755 .azure-pipelines/build_steps.sh rename .ci_support/{linux_.yaml => linux_64_.yaml} (68%) create mode 100644 .github/CODEOWNERS delete mode 100644 .github/CONTRIBUTING.md delete mode 100644 .github/ISSUE_TEMPLATE.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100755 .scripts/build_steps.sh rename {.azure-pipelines => .scripts}/run_docker_build.sh (50%) create mode 100755 build-locally.py diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index 7f1c9e3..adce9a5 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -6,18 +6,19 @@ jobs: - job: linux pool: vmImage: ubuntu-16.04 - timeoutInMinutes: 360 strategy: - maxParallel: 8 matrix: - linux_: - CONFIG: linux_ - UPLOAD_PACKAGES: True + linux_64_: + CONFIG: linux_64_ + UPLOAD_PACKAGES: 'True' + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-comp7 + timeoutInMinutes: 360 + steps: - script: | - sudo pip install --upgrade pip - sudo pip install setuptools shyaml - displayName: Install dependencies + rm -rf /opt/ghc + df -h + displayName: Manage disk space # configure qemu binfmt-misc running. This allows us to run docker containers # embedded qemu-static @@ -27,7 +28,13 @@ jobs: condition: not(startsWith(variables['CONFIG'], 'linux_64')) displayName: Configure binfmt_misc - - script: .azure-pipelines/run_docker_build.sh + - script: | + export CI=azure + export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME + export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) + .scripts/run_docker_build.sh displayName: Run docker build env: - BINSTAR_TOKEN: $(BINSTAR_TOKEN) \ No newline at end of file + BINSTAR_TOKEN: $(BINSTAR_TOKEN) + FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.azure-pipelines/build_steps.sh b/.azure-pipelines/build_steps.sh deleted file mode 100755 index 779d52b..0000000 --- a/.azure-pipelines/build_steps.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -# PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here -# will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent -# changes to this script, consider a proposal to conda-smithy so that other feedstocks can also -# benefit from the improvement. - -set -xeuo pipefail -export PYTHONUNBUFFERED=1 -export FEEDSTOCK_ROOT=/home/conda/feedstock_root -export RECIPE_ROOT=/home/conda/recipe_root -export CI_SUPPORT=/home/conda/feedstock_root/.ci_support -export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" - -cat >~/.condarc < -Issue: - -
-Environment (conda list): -
- -``` -$ conda list - -``` -
- -
-Details about conda and system ( conda info ): -
- -``` -$ conda info - -``` -
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index ba618a2..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,18 +0,0 @@ - -Checklist -* [ ] Used a fork of the feedstock to propose changes -* [ ] Bumped the build number (if the version is unchanged) -* [ ] Reset the build number to `0` (if the version changed) -* [ ] [Re-rendered]( https://conda-forge.org/docs/maintainer/updating_pkgs.html#rerendering-feedstocks ) with the latest `conda-smithy` (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering) -* [ ] Ensured the license file is being packaged. - - - - diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh new file mode 100755 index 0000000..aa9727b --- /dev/null +++ b/.scripts/build_steps.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +# PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here +# will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent +# changes to this script, consider a proposal to conda-smithy so that other feedstocks can also +# benefit from the improvement. + +set -xeuo pipefail +export PYTHONUNBUFFERED=1 +export FEEDSTOCK_ROOT="${FEEDSTOCK_ROOT:-/home/conda/feedstock_root}" +export RECIPE_ROOT="${RECIPE_ROOT:-/home/conda/recipe_root}" +export CI_SUPPORT="${FEEDSTOCK_ROOT}/.ci_support" +export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" + +cat >~/.condarc </dev/null && pwd )" PROVIDER_DIR="$(basename $THISDIR)" @@ -13,6 +13,10 @@ PROVIDER_DIR="$(basename $THISDIR)" FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;) RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" +if [ -z ${FEEDSTOCK_NAME} ]; then + export FEEDSTOCK_NAME=$(basename ${FEEDSTOCK_ROOT}) +fi + docker info # In order for the conda-build process in the container to write to the mounted @@ -28,27 +32,57 @@ fi ARTIFACTS="$FEEDSTOCK_ROOT/build_artifacts" if [ -z "$CONFIG" ]; then - echo "Need to set CONFIG env variable" + set +x + FILES=`ls .ci_support/linux_*` + CONFIGS="" + for file in $FILES; do + CONFIGS="${CONFIGS}'${file:12:-5}' or "; + done + echo "Need to set CONFIG env variable. Value can be one of ${CONFIGS:0:-4}" exit 1 fi -pip install shyaml -DOCKER_IMAGE=$(cat "${FEEDSTOCK_ROOT}/.ci_support/${CONFIG}.yaml" | shyaml get-value docker_image.0 condaforge/linux-anvil-comp7 ) +if [ -z "${DOCKER_IMAGE}" ]; then + SHYAML_INSTALLED="$(shyaml -h || echo NO)" + if [ "${SHYAML_INSTALLED}" == "NO" ]; then + echo "WARNING: DOCKER_IMAGE variable not set and shyaml not installed. Trying to parse with coreutils" + DOCKER_IMAGE=$(cat .ci_support/${CONFIG}.yaml | grep '^docker_image:$' -A 1 | tail -n 1 | cut -b 3-) + if [ "${DOCKER_IMAGE}" = "" ]; then + echo "No docker_image entry found in ${CONFIG}. Falling back to condaforge/linux-anvil-comp7" + DOCKER_IMAGE="condaforge/linux-anvil-comp7" + fi + else + DOCKER_IMAGE="$(cat "${FEEDSTOCK_ROOT}/.ci_support/${CONFIG}.yaml" | shyaml get-value docker_image.0 condaforge/linux-anvil-comp7 )" + fi +fi mkdir -p "$ARTIFACTS" DONE_CANARY="$ARTIFACTS/conda-forge-build-done-${CONFIG}" rm -f "$DONE_CANARY" -# Not all providers run with a real tty. Disable using one -DOCKER_RUN_ARGS=" " + +# Allow people to specify extra default arguments to `docker run` (e.g. `--rm`) +DOCKER_RUN_ARGS="${CONDA_FORGE_DOCKER_RUN_ARGS}" +if [ -z "${CI}" ]; then + DOCKER_RUN_ARGS="-it ${DOCKER_RUN_ARGS}" +fi export UPLOAD_PACKAGES="${UPLOAD_PACKAGES:-True}" docker run ${DOCKER_RUN_ARGS} \ - -v "${RECIPE_ROOT}":/home/conda/recipe_root:ro,z \ - -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw,z \ + -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw,z,delegated \ + -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw,z,delegated \ -e CONFIG \ - -e BINSTAR_TOKEN \ -e HOST_USER_ID \ -e UPLOAD_PACKAGES \ + -e GIT_BRANCH \ + -e UPLOAD_ON_BRANCH \ + -e CI \ + -e FEEDSTOCK_NAME \ + -e CPU_COUNT \ + -e BUILD_WITH_CONDA_DEBUG \ + -e BUILD_OUTPUT_ID \ + -e BINSTAR_TOKEN \ + -e FEEDSTOCK_TOKEN \ + -e STAGING_BINSTAR_TOKEN \ $DOCKER_IMAGE \ bash \ /home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh diff --git a/LICENSE.txt b/LICENSE.txt index cba42cf..5f30279 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,5 @@ BSD 3-clause license -Copyright (c) 2015-2019, conda-forge +Copyright (c) 2015-2020, conda-forge contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 6e05966..9fef8d2 100644 --- a/README.md +++ b/README.md @@ -5,20 +5,19 @@ Home: https://github.com/mortada/fredapi Package license: Apache 2.0 -Feedstock license: BSD 3-Clause +Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/fredapi-feedstock/blob/master/LICENSE.txt) Summary: Python API for Federal Reserve Economic Data (FRED) from St. Louis Fed - - Current build status ==================== - - +
All platforms:
All platforms: - noarch disabled + + +
@@ -66,7 +65,7 @@ A feedstock is made up of a conda recipe (the instructions on what and how to bu the package) and the necessary configurations for automatic building using freely available continuous integration services. Thanks to the awesome service provided by [CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/) -and [TravisCI](https://travis-ci.org/) it is possible to build and upload installable +and [TravisCI](https://travis-ci.com/) it is possible to build and upload installable packages to the [conda-forge](https://anaconda.org/conda-forge) [Anaconda-Cloud](https://anaconda.org/) channel for Linux, Windows and OSX respectively. diff --git a/build-locally.py b/build-locally.py new file mode 100755 index 0000000..3453cfe --- /dev/null +++ b/build-locally.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 +# +# This file has been generated by conda-smithy in order to build the recipe +# locally. +# +import os +import glob +import subprocess +from argparse import ArgumentParser + + +def setup_environment(ns): + os.environ["CONFIG"] = ns.config + os.environ["UPLOAD_PACKAGES"] = "False" + if ns.debug: + os.environ["BUILD_WITH_CONDA_DEBUG"] = "1" + if ns.output_id: + os.environ["BUILD_OUTPUT_ID"] = ns.output_id + + +def run_docker_build(ns): + script = ".scripts/run_docker_build.sh" + subprocess.check_call([script]) + + +def verify_config(ns): + valid_configs = { + os.path.basename(f)[:-5] for f in glob.glob(".ci_support/*.yaml") + } + print(f"valid configs are {valid_configs}") + if ns.config in valid_configs: + print("Using " + ns.config + " configuration") + return + elif len(valid_configs) == 1: + ns.config = valid_configs.pop() + print("Found " + ns.config + " configuration") + elif ns.config is None: + print("config not selected, please choose from the following:\n") + selections = list(enumerate(sorted(valid_configs), 1)) + for i, c in selections: + print(f"{i}. {c}") + s = input("\n> ") + idx = int(s) - 1 + ns.config = selections[idx][1] + print(f"selected {ns.config}") + else: + raise ValueError("config " + ns.config + " is not valid") + # Remove the following, as implemented + if not ns.config.startswith("linux"): + raise ValueError( + f"only Linux configs currently supported, got {ns.config}" + ) + + +def main(args=None): + p = ArgumentParser("build-locally") + p.add_argument("config", default=None, nargs="?") + p.add_argument( + "--debug", + action="store_true", + help="Setup debug environment using `conda debug`", + ) + p.add_argument( + "--output-id", help="If running debug, specify the output to setup." + ) + + ns = p.parse_args(args=args) + verify_config(ns) + setup_environment(ns) + + run_docker_build(ns) + + +if __name__ == "__main__": + main()