Last active
October 16, 2018 19:04
-
-
Save pkgw/3ea2ddd77c4e7fcf7f2cbcf566d3f4f7 to your computer and use it in GitHub Desktop.
Manually perform the "rebuild" conda-forge operation (update for Python 3.7, etc.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
from conda_forge_tick import auto_tick | |
import networkx as nx | |
HARDCODED_GRAPH_PATH = '/home/peter/sw/conda/cf-graph3/graph.pkl' | |
def go(package_name, recipe_dir): | |
print('= A ==================================================================') | |
gx = nx.read_gpickle(HARDCODED_GRAPH_PATH) | |
migrators = [] | |
auto_tick.add_rebuild(migrators, gx) | |
print('= B ==================================================================') | |
rv = migrators[0].migrate(recipe_dir, gx[package_name]) | |
print('= C ==================================================================') | |
print(repr(rv)) | |
assert rv, 'Migration failed.' | |
print('= done ===============================================================') | |
if __name__ == '__main__': | |
import sys, os.path | |
feedstock_dir = sys.argv[1] | |
assert feedstock_dir.endswith('-feedstock'), 'argv[1] should end with "-feedstock"' | |
package_name = os.path.split(feedstock_dir)[-1].replace('-feedstock', '') | |
recipe_dir = os.path.join(feedstock_dir, 'recipe') | |
go(package_name, recipe_dir) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment