Skip to content

Commit 03927e1

Browse files
⬆️ conda
1 parent dff4a6f commit 03927e1

File tree

10 files changed

+194
-3
lines changed

10 files changed

+194
-3
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
#workflow_dispatch:
15+
16+
jobs:
17+
deploy:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up Python
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: '3.x'
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install build
31+
32+
- name: Build package
33+
run: python -m build
34+
35+
- name: Publish distribution 📦 to PyPI
36+
if: startsWith(github.ref, 'refs/tags')
37+
uses: pypa/gh-action-pypi-publish@master
38+
with:
39+
user: __token__
40+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/publish.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: publish_conda
2+
3+
on:
4+
release:
5+
types: [published]
6+
#workflow_dispatch: # on demand
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: publish-to-conda
14+
uses: GiulioRossetti/conda-package-publish-action@v1.1.0
15+
with:
16+
subdir: 'conda'
17+
AnacondaToken: ${{ secrets.ANACONDA_TOKEN }}
18+
platforms: 'all'
19+
override: true
20+
# dry_run: true
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Python Package using Conda
2+
3+
on: [push]
4+
5+
jobs:
6+
build-linux:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
max-parallel: 5
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python 3.8
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.8
17+
- name: Add conda to system path
18+
run: |
19+
# $CONDA is an environment variable pointing to the root of the miniconda directory
20+
echo $CONDA/bin >> $GITHUB_PATH
21+
- name: Install dependencies
22+
run: |
23+
conda env update --file environment.yml --name base
24+
- name: Lint with flake8
25+
run: |
26+
conda install flake8
27+
# stop the build if there are Python syntax errors or undefined names
28+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
29+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
30+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31+
- name: Test with pytest
32+
run: |
33+
conda install pytest
34+
pytest

.github/workflows/test_ubuntu.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Test and Coverage (Ubuntu)
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: [3.7, 3.8, 3.9]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: conda-incubator/setup-miniconda@v2
24+
with:
25+
auto-update-conda: true
26+
python-version: ${{ matrix.python-version }}
27+
28+
29+
- name: Install pip dependencies
30+
run: |
31+
32+
python -m pip install --upgrade pip
33+
pip install .
34+
pip install -r requirements.txt
35+
python -m pip install flake8 pytest
36+
pip install pytest pytest-cov
37+
pip install coveralls
38+
39+
- name: Lint with flake8
40+
run: |
41+
# stop the build if there are Python syntax errors or undefined names
42+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
43+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
44+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
45+
46+
- name: Test with pytest
47+
run: |
48+
pytest --cov-config=.coveragerc --cov=./ --cov-report=xml
49+
50+
- name: codecov
51+
uses: codecov/codecov-action@v1

conda/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$PYTHON setup.py install --single-version-externally-managed --record=record.txt

conda/conda_build_config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
python:
2+
- 3.7
3+
- 3.8
4+
- 3.9

conda/meta.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package:
2+
name: "nf1"
3+
version: "0.0.4"
4+
5+
source:
6+
git_rev: v0.0.4
7+
git_url: https://github.com/GiulioRossetti/f1-communities
8+
9+
requirements:
10+
host:
11+
- python
12+
- setuptools
13+
build:
14+
- python
15+
- setuptools
16+
run:
17+
- python>=3.7
18+
- numpy
19+
- matplotlib
20+
- scipy
21+
- pandas
22+
23+
about:
24+
home: https://github.com/GiulioRossetti/f1-communities
25+
license: BSD-2-Clause
26+
license_familY: BSD
27+
license_file: LICENSE
28+
summary: "NF1 - Normalized F1 score for community evaluation against ground truth"
29+
30+
extra:
31+
recipe-maintainers:
32+
- GiulioRossetti

environment.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: angel_env
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- python>=3.7
7+
- numpy
8+
- matplotlib
9+
- scipy
10+
- pandas

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
numpy
22
matplotlib
33
scipy
4-
pandas
5-
pytest==5.1.*
4+
pandas

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
setup(name='nf1',
17-
version='0.0.3',
17+
version='0.0.4',
1818
license='BSD-Clause-2',
1919
description='NF1: Normalized F1 score for community evaluation against ground truth',
2020
url='https://github.com/GiulioRossetti/f1-communities',

0 commit comments

Comments
 (0)