Skip to content

Commit

Permalink
Finalize conda & pip packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaeljolivet committed Apr 1, 2020
1 parent a19b97f commit 1c59036
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
TST_NOTEBOOK:=algebraic_model.ipynb
VERSION:=$(shell cat VERSION)

#TST_IPNB:=algebraic_model_tst.ipynb

.PHONY: doc test package tst-upload
Expand All @@ -14,15 +16,25 @@ doc:
clean:
rm -r dist

package:
package-pip:
python setup.py sdist bdist_wheel --universal

tst-upload:
package-conda :
conda build conda-recipe/meta.yaml

package : package-pip package-conda

tst-upload-pip:
twine upload --repository-url https://test.pypi.org/legacy/ dist/lca_algebraic*

upload:
upload-pip:
twine upload -u oie-minesparistech dist/lca_algebraic*

upload-conda:
anaconda upload --force ~/anaconda3/conda-bld/noarch/lca_algebraic-$(VERSION)-py_0.tar.bz2

upload : upload-pip upload-conda

test:
# ipyrmd -y --from Rmd --to ipynb $(TST_NOTEBOOK) -o $(TST_IPNB)
./test/notebook_runner.py $(TST_NOTEBOOK)
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.3
9 changes: 4 additions & 5 deletions meta.yaml → conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{% set name = "lca_algebraic" %}
{% set version = "0.0.2" %}
{% set version = "0.0.3" %}

package:
name: "{{ name|lower }}"
version: "{{ version }}"

source:
path: ./
path: ../

build:
noarch: python
number: 0
script: python -m pip install --no-deps --ignore-installed .

requirements:
host:
build:
- python
- pip
run:
Expand All @@ -26,8 +25,8 @@ requirements:
- nbconvert >=5.6.1
- nbformat >=4.4.0
- numpy >=1.16.6
- python
- pandas
- python
- salib
- scipy >=1.3.2
- seaborn >=0.9.0
Expand Down
8 changes: 5 additions & 3 deletions doc/lca.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ <h1 class="title">Module <code>lca_algebraic.lca</code></h1>
</summary>
<pre><code class="python">from collections import OrderedDict

import re
import numpy as np
from slugify import slugify
from sympy import lambdify

from .base_utils import _actName, _eprint, _getDb
Expand Down Expand Up @@ -131,6 +131,8 @@ <h1 class="title">Module <code>lca_algebraic.lca</code></h1>
def method_name(method):
return method[1] + &#34; - &#34; + method[2]

def _slugify(str) :
return re.sub(&#39;[^0-9a-zA-Z]+&#39;, &#39;_&#39;, str)

def postMultiLCAAlgebric(methods, lambdas, alpha=1, **params):
&#39;&#39;&#39;
Expand Down Expand Up @@ -283,7 +285,7 @@ <h1 class="title">Module <code>lca_algebraic.lca</code></h1>

act = _getDb(db_name).get(code)
name = act[&#39;name&#39;]
base_slug = slugify(name, separator=&#39;_&#39;)
base_slug = _slugify(name)

slug = base_slug
i = 1
Expand Down Expand Up @@ -375,7 +377,7 @@ <h2 id="returns">Returns</h2>

act = _getDb(db_name).get(code)
name = act[&#39;name&#39;]
base_slug = slugify(name, separator=&#39;_&#39;)
base_slug = _slugify(name)

slug = base_slug
i = 1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def read(fname):

setup(
name = "lca_algebraic",
version = "0.0.2",
version = "0.0.3",
author = "OIE - Mines ParisTech",
author_email = "[email protected]",
description = ("This library provides a layer above brightway2 for defining parametric models and running super fast LCA for monte carlo analysis."),
Expand Down

0 comments on commit 1c59036

Please sign in to comment.