-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fixes for ruamel_yaml #57
Conversation
jakirkham
commented
Nov 7, 2016
- Fixes the version patching.
- Uses a tarball with checksum for the source.
- Adds a bit more metadata.
requirements: | ||
build: | ||
- python | ||
- setuptools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we run python setup.py --version
to get the version before patching, we need to meet ruamel.yaml
's requirements for setup.py
to run. This means we need setuptools
. Without this requirement, this command will fail and the VERSION
environment variable will be empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should note that as the setup.py
file we replace the existing one with does not require setuptools
, we do not need to add --single-version-externally-managed --record=record.txt
.
@@ -25,4 +25,4 @@ touch $SRC_DIR/ruamel_yaml/ext/__init__.py | |||
|
|||
cp $RECIPE_DIR/setup.py $SRC_DIR/ | |||
cp $RECIPE_DIR/__init__.py $SRC_DIR/ruamel_yaml/ | |||
sed -i -e 's/__version__.*/__version__ = "$VERSION"/' $SRC_DIR/ruamel_yaml/__init__.py | |||
sed -i -e "s/__version__.*/__version__ = "'"'"${VERSION}"'"'"/" $SRC_DIR/ruamel_yaml/__init__.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As single quotes were in use already, we are unable to inject the version from the environment variable $VERSION
. Instead we just literally write $VERSION
. Here we switch to double quotes so that is not an issue and escape them so that the $VERSION
can be written into a Python string.
@@ -1,7 +1,7 @@ | |||
# coding: utf-8 | |||
from __future__ import print_function, absolute_import | |||
|
|||
__version__ = "0.11.7" | |||
__version__ = "$VERSION" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not strictly required. However, the sed
expression would already replace this line with this change. Plus this makes it more clear to the end user what is happening with this version info. Namely it is being patched out with the contents of the $VERSION
environment variable.
source: | ||
fn: ruamel_yaml-0.11.14.tar.gz | ||
url: https://bitbucket.org/ruamel/yaml/get/0.11.14.tar.gz | ||
sha256: b78d394e192b6d0911bd59f794ceea88143fac4e373b76ed7e48143a2a29b33c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer tarballs at conda-forge and this ordering. So figured we could match this up a bit more to our expectations if there is no strong preference.
@@ -29,4 +31,6 @@ test: | |||
about: | |||
home: https://bitbucket.org/ruamel/yaml | |||
license: MIT | |||
license_family: MIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds the license_family
. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license_family
defaults to license
, so it is not necessary here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know.
Any chance we can get this or any of these other fields documented? Right now the about
docs only really mention license_file
, but nothing about license_family
, doc_url
, or dev_url
. It would also be good to know if there are any other special cases like this (e.g. BSD?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Dropped license_family
per request.
license_file: LICENSE | ||
summary: A patched copy of ruamel.yaml. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figured there should be some explanation of what this is as it has caused confusion before.
xref: conda-forge/ruamel_yaml-feedstock#1
xref: conda-forge/ruamel.yaml-feedstock#7
Anything else before this can be merged? |
Thanks, looks good! |