Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish to conda #124

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

Publish to conda #124

wants to merge 19 commits into from

Conversation

benoit-cty
Copy link
Contributor

  • Technical improvement.
  • Details:
    • Publish to conda in CI

These changes change non-functional parts of this repository : CI.

@benoit-cty benoit-cty changed the title WIP Publish to conda Publish to conda Feb 7, 2022
@benoit-cty benoit-cty marked this pull request as ready for review February 7, 2022 10:29
Copy link
Member

@benjello benjello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection but not competent enough to review

Copy link
Contributor

@sandcha sandcha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @benoit-cty 🙌
The requested changes are mainly typos and a question on an error raised by local testing (but that might not arise on CI).

.conda/README.md Outdated Show resolved Hide resolved
.conda/README.md Show resolved Hide resolved
.conda/README.md Show resolved Hide resolved
.conda/README.md Show resolved Hide resolved
.conda/README.md Outdated Show resolved Hide resolved
.conda/README.md Show resolved Hide resolved
.conda/README.md Outdated Show resolved Hide resolved
.conda/README.md Outdated Show resolved Hide resolved
.conda/README.md Outdated

- Build & Upload package:
- `conda install -c anaconda conda-build anaconda-client`
- `conda build .conda`
Copy link
Contributor

@sandcha sandcha May 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To test the procedure (but stop before publishing ^^) and seeing that some default value for PYPI_VERSION, PYPI_URL and PYPI_SHA256 already existed in meta.yaml file, I ran the build command.

Running this on macOS with miniconda produced the following error 🤔 :
Error: HTTP 404 CONNECTION FAILED for url <file:///Users/.../country-template/.conda/PYPI_URL>

@benoit-cty Do you see why this might happen and, more precisely if it means that some step is missing from the documentation or if it's a local issue?
As the process was already tested on openfisca-core and openfisca-france, my guess is that's it's a local issue and that we will be able to check this on the next CI publish-to-conda job execution.

📃 Full output

Knowing that miniconda was installed with HomeBrew that comes with Caskroom directory.

$ conda build .conda
No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.16
WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.16

Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults

Attempting to finalize metadata for openfisca-country-template
INFO:conda_build.metadata:Attempting to finalize metadata for openfisca-country-template
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/main/osx-64/repodata.json HTTP/1.1" 304 0
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/main/noarch/repodata.json HTTP/1.1" 304 0
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/r/osx-64/repodata.json HTTP/1.1" 304 0
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/r/noarch/repodata.json HTTP/1.1" 304 0
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/r/channeldata.json HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): conda.anaconda.org:443
DEBUG:urllib3.connectionpool:https://conda.anaconda.org:443 "GET /conda-forge/channeldata.json HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/main/channeldata.json HTTP/1.1" 200 None
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done


Attempting to finalize metadata for openfisca-country-template-dev
INFO:conda_build.metadata:Attempting to finalize metadata for openfisca-country-template-dev
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
BUILD START: ['openfisca-country-template-PYPI_VERSION-py_0.tar.bz2', 'openfisca-country-template-dev-PYPI_VERSION-py_0.tar.bz2']
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

 environment location: /usr/local/Caskroom/miniconda/base/conda-bld/openfisca-country-template_1652367881762/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl


The following NEW packages will be INSTALLED:

    bzip2:           1.0.8-h0d85af4_4          conda-forge
    ca-certificates: 2021.10.8-h033912b_0      conda-forge
    libffi:          3.4.2-h0d85af4_5          conda-forge
    libzlib:         1.2.11-h6c3fc93_1014      conda-forge
    ncurses:         6.3-h96cf925_1            conda-forge
    openssl:         3.0.3-hfe4f2af_0          conda-forge
    pip:             22.1-pyhd8ed1ab_0         conda-forge
    python:          3.9.12-h1cc4136_1_cpython conda-forge
    python_abi:      3.9-2_cp39                conda-forge
    readline:        8.1-h05e3726_0            conda-forge
    setuptools:      62.2.0-py39h6e9494a_0     conda-forge
    sqlite:          3.38.5-hd9f0692_0         conda-forge
    tk:              8.6.12-h5dbffcc_0         conda-forge
    tzdata:          2022a-h191b570_0          conda-forge
    wheel:           0.37.1-pyhd8ed1ab_0       conda-forge
    xz:              5.2.5-haf1e3a3_1          conda-forge
    zlib:            1.2.11-h6c3fc93_1014      conda-forge

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
Source cache directory is: /usr/local/Caskroom/miniconda/base/conda-bld/src_cache
INFO:conda_build.source:Source cache directory is: /usr/local/Caskroom/miniconda/base/conda-bld/src_cache
Downloading source to cache: PYPI_URL
INFO:conda_build.source:Downloading source to cache: PYPI_URL
Downloading file:///Users/.../country-template/.conda/PYPI_URL
INFO:conda_build.source:Downloading file:///Users/.../country-template/.conda/PYPI_URL
Error: HTTP 404 CONNECTION FAILED for url <file:///Users/.../country-template/.conda/PYPI_URL>
Elapsed: 00:00.000115

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
WARNING:conda_build.source:Error: HTTP 404 CONNECTION FAILED for url <file:///Users/sch/dev/gitruc/country-template/.conda/PYPI_URL>
Elapsed: 00:00.000115

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
Could not download file:///Users/.../country-template/.conda/PYPI_URL

Copy link
Contributor

@sandcha sandcha May 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add python3 .github/get_pypi_info.py -p OpenFisca-Country-Template to the documentation as a first step to test the building process (conda build .conda without publishing)?

Re-tested: Needs requests module.

.github/workflows/workflow.yml Show resolved Hide resolved
.github/get_pypi_info.py Outdated Show resolved Hide resolved
@MattiSG MattiSG requested a review from sandcha September 9, 2022 08:02
@benjello
Copy link
Member

@MattiSG @sandcha @benoit-cty : where are we on this PR ?

@sandcha
Copy link
Contributor

sandcha commented Dec 12, 2023

Applying rebase on this old PR, with @benoit-cty agreement. 🙂

@MattiSG
Copy link
Member

MattiSG commented May 17, 2024

@sandcha @benoit-cty what's left to do for this PR to be merged? At least it should be updated to use pyproj instead of setup.py following #139, using knowledge from openfisca/openfisca-france#2298.
This template will be used massively next Wednesday, so now is the big opportunity to add Conda publishing to 3 new countries 😉

benoit-cty and others added 13 commits May 17, 2024 15:07
@benoit-cty
Copy link
Contributor Author

I've updated the meta.yaml to support pyproj and check it with :

docker run --volume $PWD:/openfisca -i -t continuumio/anaconda3 /bin/bash
cd /openfisca
# Check meta.yaml
conda-build --check .conda
# Build
conda build -c openfisca -c conda-forge .conda

@MattiSG MattiSG requested review from sandcha and removed request for sandcha May 18, 2024 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants