Skip to content

Commit

Permalink
Merge pull request #34 from yqiqichen/devel
Browse files Browse the repository at this point in the history
Adding GitHub actions
  • Loading branch information
gregorgorjanc authored Jan 4, 2024
2 parents bf7aadf + 6552a80 commit 0a9b5fe
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish Python distributions to PyPI
on: push

jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
environment: release

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install pypa/build
run: >-
python3 -m
pip install
--upgrade
build
- name: Initialize submodules
run: |
git submodule update --init
- name: Build SDist and wheel
run: python3 -m build

- uses: actions/upload-artifact@v3
with:
path: dist/*

- name: Check metadata
run: pipx run twine check dist/*

- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Evaluate code syntax and correctness
on: [push, pull_request]

jobs:
pre-commit_and_pytest:
name: Run pre-commit and pytest
strategy:
matrix:
os: [ubuntu-latest, Windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
permissions:
contents: read

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11.x"

- uses: pre-commit/[email protected]
name: Run pre-commit

- name: Install pypa/build
run: >-
python3 -m
pip install
--upgrade
build
- name: Initialize submodules
run: |
git submodule update --init
- name: Build SDist and wheel
run: python3 -m build

- name: Install AlphaPeel
run: pip install dist/AlphaPeel-1.1.3-py3-none-any.whl

- name: Install pytest
run: |
pip install pytest
pip install pytest-benchmark
- name: Run pytest
run: |
pytest
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "AlphaImpute2"
version = "0.0.3"
authors = [
{ name="Andrew Whalen", email="[email protected]" },
]
description = "An imputation software for massive livestock populations."
# readme corresponds to the long_description
# "*.md" specifies the long_description_content_type
readme = "README.md"
license = {file = "MIT_License.txt"}
classifiers = [
"Programming Language :: Python :: 3",
]
# correspond to install_requires
dependencies = [
"numpy>=1.19",
"numba>=0.49.0"
]

[project.scripts]
# correspond to entry_points
AlphaImpute2 = "alphaimpute2.alphaimpute2:main"

[project.urls]
"Homepage" = "https://github.com/AlphaGenes/AlphaImpute2"
"Bug Tracker" = "https://github.com/AlphaGenes/AlphaImpute2/issues"

[tool.setuptools]
package-dir = {"" = "src"}
packages = ["alphaimpute2", "alphaimpute2.tinyhouse", "alphaimpute2.Imputation"]

0 comments on commit 0a9b5fe

Please sign in to comment.