Skip to content
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
38 changes: 19 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This workflows 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

name: PyPI
name: Publish to PyPI

on:
release:
Expand All @@ -10,21 +7,24 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest

environment: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Checkout project
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
python-version-file: pyproject.toml

- name: Build
run: |
python -m build --sdist --wheel .
twine upload dist/*
uv build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
32 changes: 27 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0 # Replace by any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: detect-private-key
- id: pretty-format-json
args: [--autofix]
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.15.0
hooks:
- id: pretty-format-toml
args: [--autofix]
- id: pretty-format-yaml
args: [--autofix]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.7
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix, --show-fixes]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]
87 changes: 65 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,71 @@
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"

[project]
name = "gopher-enrich"
dynamic = ["version"]
authors = [
{name = "William E Fondrie", email = "wfondrie@talus.bio"},
]
description = "Gene ontology enrichment analysis using protein expression."
readme = "README.md"
license = {text = "Apache 2.0"}
requires-python = ">=3.12"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
dependencies = [
"numpy>=2.0",
"pandas",
"scipy>=1.7.1",
"statsmodels",
"requests",
"numba",
"seaborn",
"biopython",
]

[project.urls]
"Homepage" = "https://github.com/TalusBio/gopher"
"Documentation" = "https://TalusBio.github.io/gopher"
"Bug Tracker" = "https://github.com/TalusBio/gopher/issues"
"Discussion Board" = "https://github.com/TalusBio/gopher/discussions"

[project.optional-dependencies]
docs = [
"numpydoc>=1.0.0",
"sphinx-argparse>=0.2.5",
"pydata-sphinx-theme>=0.4.3",
"nbsphinx>=0.7.1",
"ipykernel>=5.3.0",
"recommonmark>=0.5.0",
]
dev = [
"pre-commit>=2.7.1",
"ruff",
"pytest"
]

[project.scripts]
gopher = "gopher.gopher:main"

[tool.setuptools_scm]

[tool.black]
[tool.ruff]
line-length = 79
target-version = ['py37']
include = '\.pyi?$'
exclude = '''

(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
| foo.py # also separately exclude a file named foo.py in
# the root of the project
)
'''
target-version = "py312"

[tool.ruff.lint]
# D213 Multi-line docstring summary should start at the second lin
# D203 1 blank line required before class docstring
# D100 Missing docstring in public module
# D401 First line of docstring should be in imperative mood
ignore = ["D213", "D203", "D100", "D401"]
select = ["E", "F", "W", "C", "I", "D", "UP", "N", "T20"]

[tool.ruff.lint.per-file-ignores]
"*tests/*.py" = ["ANN", "N806", "C408"]
"__init__.py" = ["F401", "D104"]
47 changes: 0 additions & 47 deletions setup.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions setup.py

This file was deleted.

Loading
Loading