diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml new file mode 100755 index 0000000..9ffb709 --- /dev/null +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -0,0 +1,32 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + +jobs: +- job: linux + pool: + vmImage: ubuntu-16.04 + timeoutInMinutes: 360 + strategy: + maxParallel: 8 + matrix: + linux_: + CONFIG: linux_ + UPLOAD_PACKAGES: True + DOCKER_IMAGE: condaforge/linux-anvil-comp7 + steps: + # configure qemu binfmt-misc running. This allows us to run docker containers + # embedded qemu-static + - script: | + docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes + ls /proc/sys/fs/binfmt_misc/ + condition: not(startsWith(variables['CONFIG'], 'linux_64')) + displayName: Configure binfmt_misc + + - script: | + export CI=azure + export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME + .scripts/run_docker_build.sh + displayName: Run docker build + env: + BINSTAR_TOKEN: $(BINSTAR_TOKEN) \ No newline at end of file diff --git a/.ci_support/linux_.yaml b/.ci_support/linux_.yaml index 2ce6b6c..627331f 100644 --- a/.ci_support/linux_.yaml +++ b/.ci_support/linux_.yaml @@ -1,11 +1,9 @@ -build_number_decrement: -- '0' channel_sources: - conda-forge,defaults channel_targets: - conda-forge main docker_image: -- condaforge/linux-anvil +- condaforge/linux-anvil-comp7 pin_run_as_build: python: min_pin: x.x diff --git a/.circleci/checkout_merge_commit.sh b/.circleci/checkout_merge_commit.sh deleted file mode 100755 index 9528e4b..0000000 --- a/.circleci/checkout_merge_commit.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - - -# Update PR refs for testing. -if [[ -n "${CIRCLE_PR_NUMBER}" ]] -then - FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/head:pr/${CIRCLE_PR_NUMBER}/head" - FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/merge:pr/${CIRCLE_PR_NUMBER}/merge" -fi - -# Retrieve the refs. -if [[ -n "${CIRCLE_PR_NUMBER}" ]] -then - git fetch -u origin ${FETCH_REFS} -fi - -# Checkout the PR merge ref. -if [[ -n "${CIRCLE_PR_NUMBER}" ]] -then - git checkout -qf "pr/${CIRCLE_PR_NUMBER}/merge" -fi - -# Check for merge conflicts. -if [[ -n "${CIRCLE_PR_NUMBER}" ]] -then - git branch --merged | grep "pr/${CIRCLE_PR_NUMBER}/head" > /dev/null -fi diff --git a/.circleci/config.yml b/.circleci/config.yml index ede1d94..6ad461b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,26 +1,24 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + version: 2 jobs: - build_linux_: + build: working_directory: ~/test machine: true - environment: - - CONFIG: "linux_" steps: - - checkout - - run: - name: Fast finish outdated PRs and merge PRs - command: | - ./.circleci/fast_finish_ci_pr_build.sh - ./.circleci/checkout_merge_commit.sh - - run: - command: docker pull condaforge/linux-anvil - run: - # Run, test and (if we have a BINSTAR_TOKEN) upload the distributions. - command: ./.circleci/run_docker_build.sh + # The Circle-CI build should not be active, but if this is not true for some reason, do a fast finish. + command: exit 0 workflows: version: 2 build_and_test: jobs: - - build_linux_ + - build: + filters: + branches: + ignore: + - /.*/ diff --git a/.circleci/fast_finish_ci_pr_build.sh b/.circleci/fast_finish_ci_pr_build.sh deleted file mode 100755 index 8c048ac..0000000 --- a/.circleci/fast_finish_ci_pr_build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -curl https://raw.githubusercontent.com/conda-forge/conda-forge-ci-setup-feedstock/branch2.0/recipe/conda_forge_ci_setup/ff_ci_pr_build.py | \ - python - -v --ci "circle" "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" "${CIRCLE_BUILD_NUM}" "${CIRCLE_PR_NUMBER}" diff --git a/.gitattributes b/.gitattributes index 974953e..86ff937 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,3 +5,20 @@ meta.yaml text eol=lf build.sh text eol=lf bld.bat text eol=crlf + +# github helper pieces to make some files not show up in diffs automatically +.azure-pipelines/* linguist-generated=true +.circleci/* linguist-generated=true +.drone/* linguist-generated=true +.drone.yml linguist-generated=true +.github/* linguist-generated=true +.travis/* linguist-generated=true +.appveyor.yml linguist-generated=true +.gitattributes linguist-generated=true +.gitignore linguist-generated=true +.travis.yml linguist-generated=true +LICENSE.txt linguist-generated=true +README.md linguist-generated=true +azure-pipelines.yml linguist-generated=true +build-locally.py linguist-generated=true +shippable.yml linguist-generated=true diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..b09fdcb --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @ianozsvald @ps-git \ No newline at end of file diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index d87090f..0000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,15 +0,0 @@ -Thanks for your interest in helping out conda-forge. - -Whether you are brand new or a seasoned maintainer, we always appreciate -feedback from the community about how we can improve conda-forge. If you -are submitting a PR or issue, please fill out the respective template. Should -any questions arise please feel free to ask the maintainer team of the -respective feedstock or reach out to `@conda-forge/core` for more complex -issues. - -In the case of any issues reported, please be sure to demonstrate the relevant -issue (even if it is an absence of a feature). Providing this information will -help busy maintainers understand what it is you hope to accomplish. Also this -will help provide them clues as to what might be going wrong. These examples -can also be reused as tests in the build to ensure further packages meet these -criteria. This is requested to help you get timely and relevant feedback. :) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index fc95334..0000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,25 +0,0 @@ - -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 047fdaf..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/conda_smithy.html#how-to-re-render ) 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/.circleci/build_steps.sh b/.scripts/build_steps.sh similarity index 56% rename from .circleci/build_steps.sh rename to .scripts/build_steps.sh index 258a085..8a4af44 100755 --- a/.circleci/build_steps.sh +++ b/.scripts/build_steps.sh @@ -7,34 +7,33 @@ 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 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)" FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;) RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" @@ -25,26 +28,48 @@ 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 ) +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. Falling back to condaforge/linux-anvil-comp7" + DOCKER_IMAGE="condaforge/linux-anvil-comp7" + 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" -docker run -it \ - -v "${RECIPE_ROOT}":/home/conda/recipe_root \ - -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root \ +if [ -z "${CI}" ]; then + DOCKER_RUN_ARGS="-it " +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 \ -e CONFIG \ -e BINSTAR_TOKEN \ -e HOST_USER_ID \ + -e UPLOAD_PACKAGES \ + -e GIT_BRANCH \ + -e UPLOAD_ON_BRANCH \ + -e CI \ $DOCKER_IMAGE \ bash \ - /home/conda/feedstock_root/.circleci/build_steps.sh + /home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh # verify that the end of the script was reached test -f "$DONE_CANARY" \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt index 72dc8fd..cba42cf 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,5 @@ BSD 3-clause license -Copyright (c) 2015-2018, conda-forge +Copyright (c) 2015-2019, conda-forge 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 bf538bb..beb200e 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,22 @@ Package license: BSD-2-Clause Feedstock license: BSD 3-Clause -Summary: IPython tool to report memory usage deltas for every command you type +Summary: ['IPython tool to report memory usage deltas for every command you type. If you are running out of RAM then use this tool to understand what’s happening. It also records the time spent running each command.'] Current build status ==================== -All platforms: -[![noarch](https://img.shields.io/circleci/project/github/conda-forge/ipython_memory_usage-feedstock/master.svg?label=noarch)](https://circleci.com/gh/conda-forge/ipython_memory_usage-feedstock) + + + + +
All platforms: + + + +
Current release info ==================== @@ -49,6 +56,8 @@ conda search ipython_memory_usage --channel conda-forge About conda-forge ================= +[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](http://numfocus.org) + conda-forge is a community-led conda channel of installable packages. In order to provide high-quality builds, the process has been automated into the conda-forge GitHub organization. The conda-forge organization contains one repository @@ -103,3 +112,10 @@ In order to produce a uniquely identifiable distribution: * If the version of a package **is** being increased, please remember to return the [``build/number``](https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#build-number-and-string) back to 0. + +Feedstock Maintainers +===================== + +* [@ianozsvald](https://github.com/ianozsvald/) +* [@ps-git](https://github.com/ps-git/) + diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..ad85a2c --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,6 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + +jobs: + - template: ./.azure-pipelines/azure-pipelines-linux.yml \ No newline at end of file diff --git a/build-locally.py b/build-locally.py new file mode 100755 index 0000000..8f7ecca --- /dev/null +++ b/build-locally.py @@ -0,0 +1,63 @@ +#!/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" + + +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="?") + + ns = p.parse_args(args=args) + verify_config(ns) + setup_environment(ns) + + run_docker_build(ns) + + +if __name__ == "__main__": + main() diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 93d620b..bd5c8dd 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,5 +1,5 @@ {% set name = "ipython_memory_usage" %} -{% set version = "1.1" %} +{% set version = "1.2" %} package: name: {{ name|lower }} @@ -7,7 +7,7 @@ package: source: url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz - sha256: 1f4697210257f853fea74de0cf3fae60a32e550e578bac6f46de9b40c550422b + sha256: 1704ada665410f0443052efc108f4c8819c60bb7b0d6e7b253a098f0a66284d0 build: noarch: python @@ -18,23 +18,28 @@ requirements: host: - python - pip + run: - python - - memory_profiler - ipython test: - imports: - - ipython_memory_usage + commands: + - python -m IPython "import ipython_memory_usage" about: home: https://github.com/ianozsvald/ipython_memory_usage license: BSD-2-Clause license_family: BSD - license_file: {{ RECIPE_DIR }}/LICENSE - summary: 'IPython tool to report memory usage deltas for every command you type' - dev_url: https://github.com/ianozsvald/ipython_memory_usage + license_file: LICENSE + summary: | + IPython tool to report memory usage deltas for every command you type. + If you are running out of RAM then use this tool to understand what’s + happening. It also records the time spent running each command. extra: recipe-maintainers: - xhochy + - ianozsvald + - ps-git +