Skip to content

Instantly share code, notes, and snippets.

@pkgw
Last active October 16, 2018 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkgw/3ea2ddd77c4e7fcf7f2cbcf566d3f4f7 to your computer and use it in GitHub Desktop.
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.)
#! /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