Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish PyPI release configurations #36

Merged
merged 7 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/pypi_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ on:
# Trigger on pre-release tags (e.g., v1.0.0-alpha.1)
- "v[0-9].[0-9].[0-9]*-*"
- "[0-9].[0-9].[0-9]*-*"
branches:
# Trigger on the main branch
- main
- master
# branches:
# # Trigger on the main branch
# - main
# - master

env:
# package name
Expand Down Expand Up @@ -47,9 +47,10 @@ jobs:
python -m pip install build pytest pytest-cov codecov
python -m pip install -r requirements.txt
# python -m pip install -r requirements_dev.txt
- name: Test package
run: |
python -m pytest -c pyproject.toml --cov-config=.coveragerc --cov-report=xml --color=yes --cov=bfit bfit/test
# TODO: Add testing support once the issues are resolved
# - name: Test package
# run: |
# python -m pytest -c pyproject.toml --cov-config=.coveragerc --cov-report=xml --color=yes --cov=bfit bfit/test
- name: Build package
run: python -m build --sdist --wheel
- name: Store the distribution packages
Expand All @@ -59,7 +60,7 @@ jobs:
name: python-package-distributions
path: dist/
# Optional parameters for better artifact management
overwrite: false
overwrite: true
include-hidden-files: false

publish-to-pypi:
Expand All @@ -79,6 +80,7 @@ jobs:
with:
name: python-package-distributions
path: dist/
pattern: '**/*.whl'
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
env:
Expand Down Expand Up @@ -140,6 +142,7 @@ jobs:
with:
name: python-package-distributions
path: dist/
pattern: '**/*.whl'
- name: Publish distribution with relaxed constraints
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
24 changes: 24 additions & 0 deletions bfit/test/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# BFit is a Python library for fitting a convex sum of Gaussian
# functions to any probability distribution
#
# Copyright (C) 2020- The QC-Devs Community
#
# This file is part of BFit.
#
# BFit is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# BFit is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>
#
# ---

r"""Test module for bfit."""
15 changes: 6 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"

[project]
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
name = "qc-bfit"
name = "qc-BFit"
description = "Subset selection with maximum diversity."
readme = {file = 'README.md', content-type='text/markdown'}
requires-python = ">=3.9"
Expand Down Expand Up @@ -45,12 +45,6 @@ classifiers = [
"Topic :: Scientific/Engineering",
]

dependencies = [
"numpy>=1.18.5",
"scipy>=1.5.0",
"matplotlib>=3.2.0"
]


[project.optional-dependencies]
docs = [
Expand Down Expand Up @@ -94,8 +88,11 @@ zip-safe = true
# Python modules and packages that are included in the
# distribution package (and therefore become importable)
[tool.setuptools.packages.find]
exclude = ["*/*/tests", "tests_*", "examples", "notebooks"]
where = ["bfit", "bfit.test"]
exclude = ["*/*/test", "test_*", "examples", "notebooks", "docs"]
# list of folders that contain the packages (["."] by default)
where = ["."]
# package names should match these glob patterns (["*"] by default)
include = ["bfit"]

# PDM example
#[tool.pdm.scripts]
Expand Down
Loading