By the power of Grayskull... I have the Conda recipe!
The main goal of the Skeletonr is to conquer Grayskull.
Introduction
All jokes aside, the new project grayskull was created with the intention of generating better Conda recipes that would allow to package properly projects available in different channels such as PyPI, CRAN, Conan, GitHub register, GitHub repositories and so on. On top of that, Grayskull is also being developed to help conda-forge to update recipes.
Current status
Currently, Grayskull (version 0.2.1
) is able to generate recipes just
looking for packages on PyPI, and it is available
on PyPI and
conda-forge. The
GitHub repository for this package is:
marcelotrevisani/grayskull.
Before Grayskull, we just had conda-build skeleton
to generate recipes
for Python packages on PyPI. In all other aspects, the difference of
quality of the generated recipes, and also the time spent to generate
them have a big discrepancy when compared to conda-build skeleton
and
grayskull
. Grayskull generates recipes taking in consideration the
platform, Python version available, selectors, compilers (Fortran, C and
C++), packages constrains, license type, license file, and so forth. It
uses metadata available from multiple sources to try to create the best
recipe possible.
Installation
You can install grayskull
using pip
or conda
. Grayskull
does not
rely on conda
to run and can generate recipes with minimum
dependencies.
With conda
Grayskull is available on the conda-forge channel.
conda install -c conda-forge grayskull
With pip
pip install grayskull
Grayskull vs conda-build skeleton
There are some differences of recipes generated by grayskull
and
conda skeleton
. Taking as example the pytest
recipe, which has
selectors for platforms, Python version constrains, and has several
package constrains as well.
Grayskull (0.2.1) - took 4 seconds to generate the recipe
{% set name = "pytest" %}
{% set version = "5.3.5" %}
package:
name: {{ name|lower }}
version: {{ version }}
source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: 0d5fe9189a148acc3c3eb2ac8e1ac0742cb7618c084f3d228baaec0c254b318d
build:
number: 0
skip: true # [py2k]
entry_points:
- pytest=pytest:main
- py.test=pytest:main
script: {{ PYTHON }} -m pip install . -vv
requirements:
host:
- pip
- python
- setuptools >=40.0
- setuptools_scm
run:
- atomicwrites >=1.0 # [win]
- attrs >=17.4.0
- colorama # [win]
- importlib-metadata >=0.12 # [py<38]
- more-itertools >=4.0.0
- packaging
- pathlib2 >=2.2.0 # [py<36]
- pluggy <1.0,>=0.12
- py >=1.5.0
- python
- wcwidth
test:
imports:
- pytest
commands:
- pip check
- pytest --help
- py.test --help
requires:
- pip
about:
home: https://pypi.org/project/pytest/
summary: 'pytest: simple powerful testing with Python'
dev_url: https://github.com/pytest-dev/pytest
license: MIT
license_file: LICENSE
extra:
recipe-maintainers:
- marcelotrevisani
Skeleton (3.18.11) - took 31 seconds to generate the recipe
{% set name = "pytest" %}
{% set version = "5.3.5" %}
package:
name: "{{ name|lower }}"
version: "{{ version }}"
source:
url: "https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz"
sha256: 0d5fe9189a148acc3c3eb2ac8e1ac0742cb7618c084f3d228baaec0c254b318d
build:
number: 0
script: "{{ PYTHON }} -m pip install . -vv"
requirements:
host:
- atomicwrites >=1.0
- attrs >=17.4.0
- colorama;sys_platform =="win32"
- importlib-metadata >=0.12
- more-itertools >=4.0.0
- packaging
- pathlib2 >=2.2.0
- pip
- pluggy >=0.12,<1.0
- py >=1.5.0
- python
- wcwidth
run:
- atomicwrites >=1.0
- attrs >=17.4.0
- colorama;sys_platform =="win32"
- importlib-metadata >=0.12
- more-itertools >=4.0.0
- packaging
- pathlib2 >=2.2.0
- pluggy >=0.12,<1.0
- py >=1.5.0
- python
- wcwidth
about:
home: The package home page
license: MIT
license_family: MIT
license_file:
summary: "pytest: simple powerful testing with Python"
doc_url:
dev_url:
extra:
recipe-maintainers:
- your-github-id-here
Original recipe on conda-forge
for pytest 5.3.5
{% set version = "5.3.5" %}
package:
name: pytest
version: {{ version }}
source:
url: https://pypi.io/packages/source/p/pytest/pytest-{{ version }}.tar.gz
sha256: 0d5fe9189a148acc3c3eb2ac8e1ac0742cb7618c084f3d228baaec0c254b318d
build:
skip: True # [py27]
number: 1
script: "{{ PYTHON }} setup.py install --single-version-externally-managed --record record.txt"
entry_points:
- py.test = py.test:main
- pytest = py.test:main
requirements:
host:
- pip
- python
- setuptools >=40.0
- setuptools_scm
run:
- atomicwrites >=1.0 # [win]
- attrs >=17.4.0
- colorama # [win]
- importlib_metadata >=0.12 # [py<38]
- more-itertools >=4.0
- packaging
- pathlib2 >=2.2.0 # [py<36]
- pluggy >=0.12,<1.0
- py >=1.5.0
- python
- setuptools >=40.0
- wcwidth
run_constrained:
# pytest-faulthandler 2 is a dummy package.
# if an older version of fault-handler is installed, it will conflict with pytest >=5.
- pytest-faulthandler >=2
test:
commands:
- pytest -h
imports:
- pytest
about:
home: https://docs.pytest.org/en/latest/
license: MIT
license_file: LICENSE
summary: 'Simple and powerful testing with Python.'
description: |
The pytest framework makes it easy to write small tests, yet scales to
support complex functional testing for applications and libraries.
doc_url: https://docs.pytest.org/en/latest/
dev_url: https://github.com/pytest-dev/pytest/
extra:
recipe-maintainers:
- flub
- goanpeca
- nicoddemus
- ocefpaf
- mingwandroid
Major differences
Attribute | Grayskull (0.2.1) | Skeleton (3.18.11) |
---|---|---|
Command | ✅ grayskull pypi pytest | ✅ conda skeleton pypi pytest |
Time | ✅ 4 seconds | ❌ 31 seconds |
License | ✅ Added the license file and license type correctly | ❗️ Added just the license type |
Host Requirements |