From 347187b9a50818e1725e02472222be5d90e3b975 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Tue, 6 Oct 2020 17:12:22 +0200 Subject: [PATCH 1/6] Change feedstock to package upstream tzdata --- recipe/build.sh | 6 +++++ recipe/meta.yaml | 57 +++++++++++++++++++++++++++++++++--------------- 2 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 recipe/build.sh diff --git a/recipe/build.sh b/recipe/build.sh new file mode 100644 index 0000000..22bd3cf --- /dev/null +++ b/recipe/build.sh @@ -0,0 +1,6 @@ +make -e \ + TOPDIR="${PREFIX}" \ + USRDIR='' \ + POSIXRULES='' \ + ZFLAGS='-b slim' \ + install_data diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 32bc7a6..a7986d0 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,41 +1,62 @@ -{% set version = "2020.1" %} +{% set version = "2020a" %} package: name: tzdata version: {{ version }} source: - url: https://pypi.io/packages/source/t/tzdata/tzdata-{{ version }}.tar.gz - sha256: 5e0a01117b3dfc9be27ef727e8f39e355e29bbc788bcd8fe2110871df5f9a935 + - url: https://data.iana.org/time-zones/releases/tzdata{{ version }}.tar.gz + sha256: 547161eca24d344e0b5f96aff6a76b454da295dc14ed4ca50c2355043fb899a2 + - url: https://data.iana.org/time-zones/releases/tzcode{{ version }}.tar.gz + sha256: 7d2af7120ee03df71fbca24031ccaf42404752e639196fe93c79a41b38a6d669 build: number: 0 - noarch: python - script: "{{ PYTHON }} -m pip install . -vv" + noarch: generic + ignore_run_exports: + - libgcc-ng requirements: + build: + - {{ compiler('c') }} + - make host: - - python - - pip run: - - python test: - imports: - - tzdata + commands: + # Make sure we only package zoneinfo and nothing else. + - | + dirs="$( + find "${PREFIX}" -mindepth 1 -maxdepth 2 \ + \! -path "${PREFIX}/share" \! -path "${PREFIX}/conda-meta*" + )" + test "${dirs}" = "${PREFIX}/share/zoneinfo" + # Make sure we only package timezone information files. + - | + heads="$( + find "${PREFIX}/share/zoneinfo" -type f \ + -exec head -c4 {} \; -printf \\n \ + | uniq + )" + test "${heads}" = TZif about: - home: https://github.com/python/tzdata - license: Apache-2.0 + home: https://www.iana.org/time-zones + dev_url: https://github.com/eggert/tz + doc_url: https://data.iana.org/time-zones/tz-link.html + license: Public Domain license_file: LICENSE - summary: Provider of IANA time zone data + summary: The Time Zone Database (called tz, tzdb or zoneinfo) description: | - This is a Python package containing zic-compiled binaries for the IANA time zone database. - It is intended to be a fallback for systems that do not have system time zone data installed (or don't have it installed in a standard location), - as a part of PEP 615. - + The Time Zone Database (called tz, tzdb or zoneinfo) contains code and + data that represent the history of local time for many representative + locations around the globe. It is updated periodically to reflect + changes made by political bodies to time zone boundaries, UTC offsets, + and daylight-saving rules. + extra: recipe-maintainers: - ocefpaf - - pganssle + - mbargull From fe36ef253a941e24b08a14746941c255f52eebaa Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Tue, 6 Oct 2020 17:12:40 +0200 Subject: [PATCH 2/6] MNT: Re-rendered with conda-build 3.20.3, conda-smithy 3.7.10, and conda-forge-pinning 2020.10.06.07.41.18 --- .azure-pipelines/azure-pipelines-linux.yml | 10 ++++++++-- .ci_support/{linux_.yaml => linux_64_.yaml} | 10 ++++------ .github/CODEOWNERS | 2 +- .scripts/build_steps.sh | 5 +++-- .scripts/run_docker_build.sh | 8 +++++++- LICENSE.txt | 2 +- README.md | 18 ++++++++++-------- 7 files changed, 34 insertions(+), 21 deletions(-) rename .ci_support/{linux_.yaml => linux_64_.yaml} (57%) diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index e34c3a2..89ab23f 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -8,14 +8,19 @@ jobs: vmImage: ubuntu-16.04 strategy: matrix: - linux_: - CONFIG: linux_ + linux_64_: + CONFIG: linux_64_ UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: condaforge/linux-anvil-comp7 maxParallel: 8 timeoutInMinutes: 360 steps: + - script: | + 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 - script: | @@ -27,6 +32,7 @@ jobs: - 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: diff --git a/.ci_support/linux_.yaml b/.ci_support/linux_64_.yaml similarity index 57% rename from .ci_support/linux_.yaml rename to .ci_support/linux_64_.yaml index 4e6ea7e..3355a94 100644 --- a/.ci_support/linux_.yaml +++ b/.ci_support/linux_64_.yaml @@ -1,12 +1,10 @@ +c_compiler: +- gcc +c_compiler_version: +- '7' channel_sources: - conda-forge,defaults channel_targets: - conda-forge main docker_image: - condaforge/linux-anvil-comp7 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.6.* *_cpython diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f158c77..2e7da9e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @ocefpaf @pganssle \ No newline at end of file +* @mbargull @ocefpaf \ No newline at end of file diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index 7077b13..7167db8 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -30,11 +30,12 @@ source run_conda_forge_build_setup make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" conda build "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + --suppress-variables ${EXTRA_CB_OPTIONS:-} \ --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" -validate_recipe_outputs "tzdata-feedstock" +validate_recipe_outputs "${FEEDSTOCK_NAME}" if [[ "${UPLOAD_PACKAGES}" != "False" ]]; then - upload_package --validate --feedstock-name="tzdata-feedstock" "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" + upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" fi touch "${FEEDSTOCK_ROOT}/build_artifacts/conda-forge-build-done-${CONFIG}" \ No newline at end of file diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 360fc69..e4d5bab 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -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 @@ -63,12 +67,14 @@ docker run ${DOCKER_RUN_ARGS} \ -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw,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 \ + -e FEEDSTOCK_NAME \ + -e CPU_COUNT \ + -e BINSTAR_TOKEN \ -e FEEDSTOCK_TOKEN \ -e STAGING_BINSTAR_TOKEN \ $DOCKER_IMAGE \ 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 6080eb5..accbe09 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,19 @@ About tzdata ============ -Home: https://github.com/python/tzdata +Home: https://www.iana.org/time-zones -Package license: Apache-2.0 +Package license: Public Domain -Feedstock license: BSD 3-Clause +Feedstock license: BSD-3-Clause -Summary: Provider of IANA time zone data +Summary: The Time Zone Database (called tz, tzdb or zoneinfo) -This is a Python package containing zic-compiled binaries for the IANA time zone database. -It is intended to be a fallback for systems that do not have system time zone data installed (or don't have it installed in a standard location), -as a part of PEP 615. +The Time Zone Database (called tz, tzdb or zoneinfo) contains code and +data that represent the history of local time for many representative +locations around the globe. It is updated periodically to reflect +changes made by political bodies to time zone boundaries, UTC offsets, +and daylight-saving rules. Current build status @@ -119,6 +121,6 @@ In order to produce a uniquely identifiable distribution: Feedstock Maintainers ===================== +* [@mbargull](https://github.com/mbargull/) * [@ocefpaf](https://github.com/ocefpaf/) -* [@pganssle](https://github.com/pganssle/) From 014ebe912268135b85e721de068b4425d636f7bc Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Tue, 6 Oct 2020 17:12:57 +0200 Subject: [PATCH 3/6] Add leapseconds, *.tab, and zic input files --- recipe/0001-Add-TABDATA-to-install_data.patch | 14 ++++++++++++++ recipe/meta.yaml | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 recipe/0001-Add-TABDATA-to-install_data.patch diff --git a/recipe/0001-Add-TABDATA-to-install_data.patch b/recipe/0001-Add-TABDATA-to-install_data.patch new file mode 100644 index 0000000..a04cee3 --- /dev/null +++ b/recipe/0001-Add-TABDATA-to-install_data.patch @@ -0,0 +1,14 @@ +--- Makefile ++++ Makefile +@@ -679,9 +679,10 @@ + ZIC='$(ZIC)' + +-INSTALL_DATA_DEPS = zic leapseconds yearistype tzdata.zi ++INSTALL_DATA_DEPS = zic leapseconds yearistype tzdata.zi $(TABDATA) + + # 'make install_data' installs one set of TZif files. + install_data: $(INSTALL_DATA_DEPS) + $(ZIC_INSTALL) tzdata.zi ++ cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' + + posix_only: $(INSTALL_DATA_DEPS) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index a7986d0..ffe772b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -7,8 +7,12 @@ package: source: - url: https://data.iana.org/time-zones/releases/tzdata{{ version }}.tar.gz sha256: 547161eca24d344e0b5f96aff6a76b454da295dc14ed4ca50c2355043fb899a2 + patches: + - 0001-Add-TABDATA-to-install_data.patch - url: https://data.iana.org/time-zones/releases/tzcode{{ version }}.tar.gz sha256: 7d2af7120ee03df71fbca24031ccaf42404752e639196fe93c79a41b38a6d669 + patches: + - 0001-Add-TABDATA-to-install_data.patch build: number: 0 @@ -25,6 +29,11 @@ requirements: test: commands: + - test -f "${PREFIX}/share/zoneinfo/leapseconds" + - test -f "${PREFIX}/share/zoneinfo/iso3166.tab" + - test -f "${PREFIX}/share/zoneinfo/zone1970.tab" + - test -f "${PREFIX}/share/zoneinfo/zone.tab" + - test -f "${PREFIX}/share/zoneinfo/tzdata.zi" # Make sure we only package zoneinfo and nothing else. - | dirs="$( @@ -36,6 +45,7 @@ test: - | heads="$( find "${PREFIX}/share/zoneinfo" -type f \ + \! -name \*.zi \! -name \*.tab \! -name leapseconds \ -exec head -c4 {} \; -printf \\n \ | uniq )" From 420f53bd8697d3680dfb82fe3a40f73bc5b3b298 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Tue, 6 Oct 2020 17:45:30 +0200 Subject: [PATCH 4/6] Add comment on why we don't skip on non-Linux --- recipe/meta.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index ffe772b..f792098 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -17,6 +17,9 @@ source: build: number: 0 noarch: generic + # The recipe assumes building on Linux, but we don't have "skip" active since + # the linter will complain with "`noarch` packages can't have selectors". + # skip: True # [not linux] ignore_run_exports: - libgcc-ng From e1778c8ffd150dd35ed16b4af89c96c50a0c00fc Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Tue, 6 Oct 2020 18:16:31 +0200 Subject: [PATCH 5/6] Build "fat" versions for compatibility --- recipe/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/recipe/build.sh b/recipe/build.sh index 22bd3cf..a0663ef 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -2,5 +2,4 @@ make -e \ TOPDIR="${PREFIX}" \ USRDIR='' \ POSIXRULES='' \ - ZFLAGS='-b slim' \ install_data From d930b2edcbf61fa1d01c9732fd0d0fb84724bf25 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Tue, 6 Oct 2020 18:34:42 +0200 Subject: [PATCH 6/6] Use upstream install target + manual copying --- recipe/0001-Add-TABDATA-to-install_data.patch | 14 -------------- recipe/build.sh | 7 +++++-- recipe/meta.yaml | 4 ---- 3 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 recipe/0001-Add-TABDATA-to-install_data.patch diff --git a/recipe/0001-Add-TABDATA-to-install_data.patch b/recipe/0001-Add-TABDATA-to-install_data.patch deleted file mode 100644 index a04cee3..0000000 --- a/recipe/0001-Add-TABDATA-to-install_data.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- Makefile -+++ Makefile -@@ -679,9 +679,10 @@ - ZIC='$(ZIC)' - --INSTALL_DATA_DEPS = zic leapseconds yearistype tzdata.zi -+INSTALL_DATA_DEPS = zic leapseconds yearistype tzdata.zi $(TABDATA) - - # 'make install_data' installs one set of TZif files. - install_data: $(INSTALL_DATA_DEPS) - $(ZIC_INSTALL) tzdata.zi -+ cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' - - posix_only: $(INSTALL_DATA_DEPS) diff --git a/recipe/build.sh b/recipe/build.sh index a0663ef..8ca4bf3 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -1,5 +1,8 @@ make -e \ - TOPDIR="${PREFIX}" \ + DESTDIR=./build \ USRDIR='' \ POSIXRULES='' \ - install_data + install + +mkdir -p "${PREFIX}/share" +mv ./build/share/zoneinfo "${PREFIX}/share/" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index f792098..3a36750 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -7,12 +7,8 @@ package: source: - url: https://data.iana.org/time-zones/releases/tzdata{{ version }}.tar.gz sha256: 547161eca24d344e0b5f96aff6a76b454da295dc14ed4ca50c2355043fb899a2 - patches: - - 0001-Add-TABDATA-to-install_data.patch - url: https://data.iana.org/time-zones/releases/tzcode{{ version }}.tar.gz sha256: 7d2af7120ee03df71fbca24031ccaf42404752e639196fe93c79a41b38a6d669 - patches: - - 0001-Add-TABDATA-to-install_data.patch build: number: 0