Skip to content

Commit

Permalink
Merge pull request #406 from zStupan/fix-workflows
Browse files Browse the repository at this point in the history
Updated PyPI and Conda workflows
  • Loading branch information
firefly-cpp authored Oct 25, 2023
2 parents 59bae04 + 396b006 commit 316f016
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 43 deletions.
41 changes: 22 additions & 19 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,30 @@ on:
types: [published]

jobs:
build:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install pipenv
run: |
python -m pip install --upgrade pip
pip install pipenv
- name: Install dependencies
run: |
pipenv install --skip-lock --dev
- name: Build package
python-version: "3.10"

- name: Install Poetry
run: |
make build
- name: Publish package
curl -sSL https://install.python-poetry.org | python - -y
- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Build project for distribution
run: poetry build

- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run:
make upload
POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: poetry publish
8 changes: 4 additions & 4 deletions conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
python:
- 3.6
- 3.7
- 3.8
- 3.9
- 3.9
- 3.10
- 3.11
- 3.12
36 changes: 16 additions & 20 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
{% set data = load_setup_py_data() %}
{% set pyproject = load_file_data('pyproject.toml') %}
{% set poetry = pyproject.get('tool', {}).get('poetry') %}

package:
name: niapy
version: {{ data['version'] }}
name: {{ poetry.get('name') }}
version: {{ poetry.get('version') }}

source:
path: ..

build:
number: 0
script: python setup.py install --single-version-externally-managed --record=record.txt
script: {{ PYTHON }} -m pip install . -vv

requirements:
build:
host:
- python
- numpy>=1.17.0
- matplotlib
- pandas
- openpyxl
- pip
- setuptools
- wheel
run:
- python
- numpy>=1.17.0
- matplotlib
- pandas
- openpyxl

test:
imports:
- niapy

about:
home: {{ data['url'] }}
license: {{ data['license'] }}
summary: {{ data['description'] }}
home: {{ poetry.get('homepage') }}
license: {{ poetry.get('license') }}
license_file: LICENSE
license_url: https://github.com/NiaOrg/NiaPy/blob/master/LICENSE
summary: {{ poetry.get('description') }}
doc_url: {{ poetry.get('documentation') }}
dev_url: {{ poetry.get('repository') }}

0 comments on commit 316f016

Please sign in to comment.