-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from dprada/main
Fixing the to update conda-envs and conda-build yaml files
- Loading branch information
Showing
14 changed files
with
169 additions
and
126 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import yaml | ||
|
||
def heal(arg): | ||
|
||
output = [] | ||
|
||
for ii in arg: | ||
if type(ii) is list: | ||
for jj in ii: | ||
if type(jj) is list: | ||
for kk in jj: | ||
if kk not in output: | ||
output.append(kk) | ||
else: | ||
if jj not in output: | ||
output.append(jj) | ||
else: | ||
if ii not in output: | ||
output.append(ii) | ||
|
||
return output | ||
|
||
with open('requirements.yaml') as fff: | ||
all_requirements = yaml.load(fff, Loader=yaml.FullLoader) | ||
|
||
# Broadcasting to conda-build | ||
|
||
## meta.yaml | ||
|
||
with open('conda-build/meta.yaml') as fff: | ||
meta = yaml.load(fff, Loader=yaml.FullLoader) | ||
|
||
meta["requirements"]["build"] = heal(all_requirements["setup"]["dependencies"]) | ||
meta["requirements"]["run"] = heal(all_requirements["production"]["dependencies"]) | ||
|
||
fff = open("conda-build/meta.yaml", "w") | ||
yaml.dump(meta, fff, sort_keys=False) | ||
fff.close() | ||
|
||
with open("conda-build/meta.yaml", "r") as fff: | ||
meta_lines = fff.readlines() | ||
|
||
with open("conda-build/meta.yaml", "w") as fff: | ||
for line in meta_lines: | ||
if line.startswith(' version:'): | ||
line = ' version: \"{{ environ[\'GIT_DESCRIBE_TAG\'] }}\"\n' | ||
fff.write(line) | ||
|
||
# Broadcasting to conda-envs | ||
|
||
## Production | ||
|
||
env_dict={} | ||
env_dict["channels"]=heal(all_requirements["production"]["channels"]) | ||
env_dict["dependencies"]=heal(all_requirements["production"]["dependencies"]) | ||
fff = open("conda-envs/production_env.yaml", "w") | ||
yaml.dump(env_dict, fff, sort_keys=False) | ||
fff.close() | ||
|
||
## Development | ||
|
||
env_dict={} | ||
env_dict["channels"]=heal(all_requirements["development"]["channels"]) | ||
env_dict["dependencies"]=heal(all_requirements["development"]["dependencies"]) | ||
fff = open("conda-envs/development_env.yaml", "w") | ||
yaml.dump(env_dict, fff, sort_keys=False) | ||
fff.close() | ||
|
||
## Test | ||
|
||
env_dict={} | ||
env_dict["channels"]=heal(all_requirements["test"]["channels"]) | ||
env_dict["dependencies"]=heal(all_requirements["test"]["dependencies"]) | ||
fff = open("conda-envs/test_env.yaml", "w") | ||
yaml.dump(env_dict, fff, sort_keys=False) | ||
fff.close() | ||
|
||
## Docs | ||
|
||
env_dict={} | ||
env_dict["channels"]=heal(all_requirements["docs"]["channels"]) | ||
env_dict["dependencies"]=heal(all_requirements["docs"]["dependencies"]) | ||
fff = open("conda-envs/docs_env.yaml", "w") | ||
yaml.dump(env_dict, fff, sort_keys=False) | ||
fff.close() | ||
|
||
## Setup | ||
|
||
env_dict={} | ||
env_dict["channels"]=heal(all_requirements["setup"]["channels"]) | ||
env_dict["dependencies"]=heal(all_requirements["setup"]["dependencies"]) | ||
fff = open("conda-envs/setup_env.yaml", "w") | ||
yaml.dump(env_dict, fff, sort_keys=False) | ||
fff.close() | ||
|
||
## Build | ||
|
||
env_dict={} | ||
env_dict["channels"]=heal(all_requirements["conda-build"]["channels"]) | ||
env_dict["dependencies"]=heal(all_requirements["conda-build"]["dependencies"]) | ||
fff = open("conda-envs/build_env.yaml", "w") | ||
yaml.dump(env_dict, fff, sort_keys=False) | ||
fff.close() | ||
|
||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,24 @@ | ||
package: | ||
name: pyunitwizard | ||
version: "{{ environ['GIT_DESCRIBE_TAG'] }}" | ||
|
||
source: | ||
path: ../../ | ||
|
||
build: | ||
number: 1 | ||
|
||
requirements: | ||
build: | ||
- python | ||
- setuptools | ||
- numpy | ||
- versioneer | ||
|
||
- python | ||
- setuptools | ||
- numpy | ||
run: | ||
- python | ||
- numpy | ||
- pint | ||
|
||
- python | ||
- pint | ||
about: | ||
home: https://uibcdf.org | ||
license: MIT License | ||
summary: "" | ||
description: | | ||
This library provides some useful methods to work with quantities | ||
dev_url: https://github.com/uibcdf/PyUnitWizard | ||
doc_url: https://uibcdf.org/PyUnitWizard | ||
summary: '' | ||
description: 'This library provides some useful methods to work with quantities | ||
' | ||
dev_url: https://github.com/uibcdf/pyunitwizard | ||
doc_url: https://uibcdf.org/pyynitwizard |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,8 @@ channels: | |
- conda-forge | ||
- default | ||
dependencies: | ||
- python | ||
- setuptools | ||
- numpy | ||
- anaconda-client | ||
- conda-build |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
channels: | ||
- conda-forge | ||
- default | ||
dependencies: | ||
- python | ||
- setuptools | ||
- numpy | ||
- versioneer |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,10 @@ channels: | |
- default | ||
dependencies: | ||
- python | ||
- pint | ||
- pytest | ||
- pip | ||
- pytest-cov | ||
- codecov | ||
- pint | ||
- openmm | ||
- unyt |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{% extends '!layout.html' %} | ||
{% block document %} | ||
{{super()}} | ||
<a href="https://github.com/uibcdf/pyunitwizard"> | ||
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"> | ||
</a> | ||
{% endblock %} | ||
|
Oops, something went wrong.