Skip to content

Commit

Permalink
Preparations for a 0.1rc1 release candidate on PyPI (#15)
Browse files Browse the repository at this point in the history
* Update changelog for initial release on PyPI
* Set package version to 0.1.0rc1
* Update installation instructions in README
Signed-off-by: Håkon Wiik Ånes <[email protected]>
  • Loading branch information
hakonanes authored Mar 10, 2022
1 parent 0515510 commit 3215bd1
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 13 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflows runs when a tagged release is created or it is triggered manually.
# For more information see:
# - Python docs: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
# - GitHub action: https://github.com/marketplace/actions/pypi-publish
# - GitHub docs: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# The source distribution (sdist) is built with the `build` package
# (https://pypa-build.readthedocs.io/en/stable/index.html).
# The sdist is uploaded to:
# - TestPyPI whenever the workflow is run
# - PyPI when the current commit is tagged

name: Upload to PyPI

on:
release:
types: [published]
workflow_dispatch:
workflow: "*"

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
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 to TestPyPI
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish package to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ report.log
# Python
**/__pycache__
*.egg-info
dist/

# Jupyter
**.ipynb_checkpoints
Expand Down
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,27 @@ available at https://pyebsdindex.readthedocs.io.

## Installation

The package can only be installed from source at the moment. There is an issue with
installing `pyopencl` from `pip` on Windows, so this has to be installed from `conda`
before installing `PyEBSDIndex`:
The package can be installed from the
[Python Package Index](https://pypi.org/project/pyebsdindex) (`pip`) or from source on
all operating systems:

```bash
pip install pyebsdindex
```

Installing with optional GPU support via `pyopencl`:

```bash
pip install pyebsdindex[gpu]
```

Please refer to the [pyopencl](https://documen.tician.de/pyopencl/misc.html)
installation documentation in case installation fails.

Installing the package from source with optional dependencies for running tests

```bash
conda install pyopencl --channel conda-forge # Only required on Windows
git clone https://github.com/USNavalResearchLaboratory/PyEBSDIndex
cd PyEBSDIndex
pip install --editable .
pip install --editable .[tests]
```
4 changes: 2 additions & 2 deletions pyebsdindex/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__author__ = "Dave Rowenhorst"
__author_email__ = ""
# Initial committer first, then sorted by line contributions
__credits__ = ["Dave Rowenhorst"]
__credits__ = "Dave Rowenhorst"
__description__ = "Python based tool for Hough/Radon based EBSD indexing"
__name__ = "pyebsdindex"
__version__ = "0.1.dev0"
__version__ = "0.1rc1"
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
license_files = License
16 changes: 10 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@
license="Custom",
python_requires=">=3.8",
description=__description__,
long_description=open("README.md", encoding="utf-8").read(),
long_description_content_type="text/markdown",
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: Custom",
"License :: Other/Proprietary License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering",
Expand All @@ -54,14 +56,15 @@
zip_safe=True,
# Contact
author=__credits__,
download_url="https://github.com/USNavalResearchLaboratory/PyEBSDIndex",
download_url="https://pypi.python.org/pypi/pyebsdindex",
maintainer=__author__,
maintainer_email=__author_email__,
project_urls={
"Bug Tracker": "https://github.com/USNavalResearchLaboratory/PyEBSDIndex/issues",
"Documentation": "https://pyebsdindex.readthedocs.io",
"Source Code": "https://github.com/USNavalResearchLaboratory/PyEBSDIndex",
},
url="https://pyebsdindex.readthedocs.io",
# Dependencies
extras_require=extra_feature_requirements,
install_requires=[
Expand All @@ -70,8 +73,6 @@
"matplotlib",
"numpy",
"numba",
#"ocl_icd_wrapper_apple;sys_platform == 'darwin'",
#"ocl-icd-system;sys_platform == 'linux'",
"pyswarms",
"ray[default]",
"scipy",
Expand All @@ -81,7 +82,10 @@
package_dir={"pyebsdindex": "pyebsdindex"},
include_package_data=True,
package_data={
"": ["License", "README.md"],
"pyebsdindex": ["*.py", "*.cl"],
"pyebsdindex": [
"*.py",
"*.cl",
"tests/data/al_sim_20kv/al_sim_20kv.png",
],
},
)

0 comments on commit 3215bd1

Please sign in to comment.