explodinglabs / jsonrpcserver

Process incoming JSON-RPC requests in Python
MIT License
186 stars 40 forks source link

Upload package to conda #87

Closed danieljfarrell closed 5 years ago

danieljfarrell commented 5 years ago

I have made a conda-build script which can be used to upload jsonrpcserver to Anaconda Cloud so it can be installed with the Conda package manager.

The script is below. Please let me know if I can assist you in upload the package to the official channel.

conda install -c danieljfarrell_teraview jsonrpcserver

{% set name = "jsonrpcserver"%}
{% set version = "4.0.4" %}

package:
  name: "{{ name|lower }}"
  version: "{{ version }}"

source:
  url: https://github.com/bcb/jsonrpcserver/archive/4.0.4.tar.gz
  sha256: 2ed9c08b6a3ee889fd4e752b84b4335bd1ddbe4e70a5956d4e2cf44d68fe9827

build:
  number: 0
  script: "python -m pip install . --no-deps --ignore-installed -vvv "

requirements:
  host:
    - python
    - apply_defaults<1
    - jsonschema>=2,<4
  run:
    - python
    - apply_defaults
    - jsonschema>=2,<4

about:
  home: https://github.com/bcb/jsonrpcserver
  license: MIT License
  license_family: MIT
  license_file: 
  summary: Process JSON-RPC requests in Python
  doc_url: https://jsonrpcserver.readthedocs.io/
  dev_url: 

extra:
  recipe-maintainers:
    - bcb
bcb commented 5 years ago

Thanks for sending this through. Had a look through the docs, it looks reasonably straight forward. Will get to it asap.

danieljfarrell commented 5 years ago

Excellent! Yes it is fairly straight forward. You may want to consider adding to conda-forge https://conda-forge.org/ rather than your own channel.

bcb commented 5 years ago

A few questions, Daniel - would it be better to use the local path as the source? Would this remove the need for the sha256? (thinking about the work involved in updating this file with every release). Also, should the recipe files be added to the repo?

danieljfarrell commented 5 years ago

This probably explains better than I can, https://conda-forge.org/#add_recipe but I will make a summary.

It’s very similar to making a new release on PyPI, but actually a bit easier.

It depends if you want to publish to your own channel or not. If so then it’s a case of making the release on GitHub, updating the hash and the version number and running the conda-build with the updated meta.yaml.

If instead you plan on uploading to conda-forge (this comes with the advantage of getting your package build of Linux, windows and MacOS automatically) the work flow is a bit different. You prepare the script in the same way but then you make a pull request to the conda-forge project and they will build the package for you.

As far as I understand it, there is not way around updating the hash manually after each release. But the same is true for releasing to PyPI.

bcb commented 5 years ago

Thanks, created PRs on conda-forge. The CI/CD failed, not sure if it's something on my end.

Screen Shot 2019-09-09 at 10 32 18
danieljfarrell commented 5 years ago

I will take a look, there is not much to go on!

danieljfarrell commented 5 years ago

OK. I took a look and your clone of staged-recipes from conda forge.

I think the problem is that you are missing these lines

requirements:
  host:
    - python
    - apply_defaults<1
    - jsonschema>=2,<4
  run:
    - python
    - apply_defaults<1
    - jsonschema>=2,<4

In the requirement https://github.com/bcb/staged-recipes/blob/de91ddbdb20211dac0ac09789e4f054cec87db03/recipes/example/meta.yaml#L35

bcb commented 5 years ago

You're right, that fixed it. All checks are passing now.

bcb commented 5 years ago

Added to conda-forge.

bcb commented 5 years ago

Thanks Daniel