Skip to content

Commit

Permalink
updated to use poetry to manage pyproject.toml (#4)
Browse files Browse the repository at this point in the history
* updated to use poetry to manage pyproject.toml

Incremental fixes throughout:
* updated CI.yaml test location given new folder structure
* packages = [ {include = missense_kinase_toolkit, from=src},] in pyproject.toml
* added [tool.pytest.ini_options] pythonpath = [src] in pyproject.toml
* removed __init__.py from src/missense_kinase_toolkit
* build now only depends on package not datetime due to CI error, include missense_kinase_toolkit in src, and updated requests_cache import in hgnc
* fixed extra format-jinja assignment
  • Loading branch information
jessicaw9910 authored Feb 21, 2024
1 parent 61dc161 commit 547385d
Show file tree
Hide file tree
Showing 10 changed files with 824 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
# conda setup requires this special shell
shell: bash -l {0}
run: |
pytest -v --cov=missense_kinase_toolkit --cov-report=xml --color=yes missense_kinase_toolkit/tests/
pytest -v --cov=missense_kinase_toolkit --cov-report=xml --color=yes tests/
- name: CodeCov
uses: codecov/codecov-action@v1
Expand Down
File renamed without changes.
7 changes: 0 additions & 7 deletions missense_kinase_toolkit/__init__.py

This file was deleted.

783 changes: 783 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

115 changes: 39 additions & 76 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,91 +1,54 @@
[build-system]
requires = ["setuptools>=61.0", "versioningit~=2.0"]
build-backend = "setuptools.build_meta"

# Self-descriptive entries which should always be present
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
[project]
name = "missense_kinase_toolkit"
[tool.poetry]
name = "missense-kinase-toolkit"
# https://github.com/mtkennerly/poetry-dynamic-versioning/issues/14
version = "0.0.0"
description = "An ETL pipeline package to facilitate structure-based ML for human kinase property prediction"
dynamic = ["version"]
authors = ["Jess White <[email protected]>"]
license = "MIT"
readme = "README.md"
authors = [
{ name = "Jess White", email = "[email protected]" }
]
license = { text = "MIT" }
# See https://pypi.org/classifiers/
repository = "https://github.com/choderalab/missense_kinase_toolkit/"
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
]
requires-python = ">=3.9"
# Declare any run-time dependencies that should be installed with the package.
dependencies = [
"importlib-resources;python_version<='3.11'",
"setuptools",
"pydantic>=1.10,<2",
"tqdm>=4.64.0",
"pandas>=2,<3",
"requests-cache>=0.9.7,<1",
"requests>=2.28.1,<3",
packages = [
{include = "missense_kinase_toolkit", from = "src"},
]

# Update the urls once the hosting is set up.
[project.urls]
"Source" = "https://github.com/choderalab/missense_kinase_toolkit/"
#"Documentation" = "https://missense_kinase_toolkit.readthedocs.io/"
[tool.poetry.dependencies]
python = "^3.9"
setuptools = "^69.1.0"
pydantic = ">=1.10,<2"
tqdm = "4.64.0"
pandas = ">=2,<3"
requests = ">=2.28.1,<3"
requests-cache = ">=0.9.7,<1"

[project.optional-dependencies]
test = [
"pytest>=6.1.2",
"pytest-runner"
]

[tool.setuptools]
# This subkey is a beta stage development and keys may change in the future, see https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html for more details
#
# As of version 0.971, mypy does not support type checking of installed zipped
# packages (because it does not actually import the Python packages).
# We declare the package not-zip-safe so that our type hints are also available
# when checking client code that uses our (installed) package.
# Ref:
# https://mypy.readthedocs.io/en/stable/installed_packages.html?highlight=zip#using-installed-packages-with-mypy-pep-561
zip-safe = false
# Let setuptools discover the package in the current directory,
# but be explicit about non-Python files.
# See also:
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#setuptools-specific-configuration
# Note that behavior is currently evolving with respect to how to interpret the
# "data" and "tests" subdirectories. As of setuptools 63, both are automatically
# included if namespaces is true (default), even if the package is named explicitly
# (instead of using 'find'). With 'find', the 'tests' subpackage is discovered
# recursively because of its __init__.py file, but the data subdirectory is excluded
# with include-package-data = false and namespaces = false.
include-package-data = false
[tool.setuptools.packages.find]
namespaces = false
where = ["."]

# Ref https://setuptools.pypa.io/en/latest/userguide/datafiles.html#package-data
[tool.setuptools.package-data]
missense_kinase_toolkit = [
"py.typed"
]
[tool.poetry.group.dev.dependencies]
black = "^24.2.0"
flake8 = "^7.0.0"

[tool.versioningit]
default-version = "1+unknown"

[tool.versioningit.format]
distance = "{base_version}+{distance}.{vcs}{rev}"
dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
[tool.poetry.group.test.dependencies]
pytest = "^8.0.1"
pytest-runner = "^6.0.1"

[tool.versioningit.vcs]
# The method key:
method = "git" # <- The method name
# Parameters to pass to the method:
match = ["*"]
default-tag = "1.0.0"
[tool.pytest.ini_options]
pythonpath = ["src"]

[tool.versioningit.write]
file = "missense_kinase_toolkit/_version.py"
[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
pattern = "^(?P<base>\\d+\\.\\d+\\.\\d+)(-?((?P<stage>[a-zA-Z]+)\\.?(?P<revision>\\d+)?))?"
format-jinja = """
{%- if distance == 0 -%}
{{- base -}}
{%- else -%}
{{- base }}.dev{{ distance }}+g{{commit}}
{%- endif -%}
"""
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import requests

import requests_wrapper
from missense_kinase_toolkit import requests_wrapper


def maybe_get_symbol_from_hgnc_search(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 547385d

Please sign in to comment.