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

Fixes for ruamel_yaml #57

Merged
merged 7 commits into from
Nov 18, 2016
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ruamel_yaml/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8
from __future__ import print_function, absolute_import

__version__ = "0.11.7"
__version__ = "$VERSION"
Copy link
Contributor Author

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.

__name__ = "ruamel_yaml"
__author__ = "Anthon van der Neut"
__author_email__ ="[email protected]"
Expand Down
12 changes: 8 additions & 4 deletions ruamel_yaml/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ package:
name: ruamel_yaml
version: 0.11.14

source:
fn: ruamel_yaml-0.11.14.tar.gz
url: https://bitbucket.org/ruamel/yaml/get/0.11.14.tar.gz
sha256: b78d394e192b6d0911bd59f794ceea88143fac4e373b76ed7e48143a2a29b33c
Copy link
Contributor Author

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.


build:
number: 0
no_link: .*\.(pyd|dll) [win]

source:
hg_url: https://bitbucket.org/ruamel/yaml
hg_tag: 0.11.14

requirements:
build:
- python
- setuptools
Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

- cython
- yaml
run:
Expand All @@ -29,4 +31,6 @@ test:
about:
home: https://bitbucket.org/ruamel/yaml
license: MIT
license_family: MIT
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adds the license_family. 😄

Copy link
Contributor

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

Copy link
Contributor Author

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?).

Copy link
Contributor Author

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.
Copy link
Contributor Author

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

2 changes: 1 addition & 1 deletion ruamel_yaml/prepare.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

@jakirkham jakirkham Nov 7, 2016

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.