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

BUG: Shake bugs out of pyproject.toml and add action to publish to PYPI #30

Open
wants to merge 2 commits into
base: 4.0.x
Choose a base branch
from
Open
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
39 changes: 39 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bfrosik should add a PYPI API token to the secrets in the settings of this repository.

21 changes: 13 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "cohere_core"
author = [
authors = [
{name = "Barbara Frosik", email = "[email protected]"},
{name = "Ross Harder"},
]
Expand All @@ -17,13 +17,13 @@ dependencies = [
]
requires-python = ">=3.6"
classifiers = [
"Intended Audience :: Science/Research"
"Programming Language :: Python :: 3.6"
"Programming Language :: Python :: 3.7"
"Programming Language :: Python :: 3.8"
"Programming Language :: Python :: 3.9"
"Programming Language :: Python :: 3.10"
"Programming Language :: Python :: 3.11"
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
description = "Tools for Bragg Coherent Diffraction Imaging (BCDI)."
readme = "README.md"
Expand All @@ -34,3 +34,8 @@ keywords = ["BCDI", "bragg", "diffraction", "imaging"]
Repository = "https://github.com/advancedPhotonSource/cohere.git"
Documentation = "https://cohere-dev.readthedocs.io/en/latest/"
Issues = "https://github.com/advancedPhotonSource/cohere/issues"

[tool.setuptools.packages.find]
where = ["."]
include = ["cohere_core.*"]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the core package is included in this project. The UI package should be built and published separately.

namespaces = false