-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from icbi-lab/improve-packaging2
Improve packaging
- Loading branch information
Showing
14 changed files
with
149 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
max_line_length = 88 | ||
|
||
[*.py] | ||
indent_size = 4 | ||
indent_style = space | ||
|
||
[Makefile] | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
*.code-workspace | ||
.vscode/* | ||
!.vscode/settings.json.default | ||
notebooks | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
[build-system] | ||
requires = ['flit'] | ||
build-backend = 'flit.buildapi' | ||
requires = [ | ||
'flit_core >=2,<4', | ||
'setuptools_scm', | ||
'pytoml', | ||
'wheel', | ||
'importlib_metadata>=0.7; python_version < "3.8"' | ||
] | ||
build-backend = 'flit_core.buildapi' | ||
|
||
[tool.flit.metadata] | ||
module = 'scirpy' | ||
author = 'Gregor Sturm' | ||
author = 'Gregor Sturm, Tamas Szabo' | ||
author-email = '[email protected]' | ||
home-page = 'https://github.com/grst/scirpy' | ||
description-file = "README.rst" | ||
|
@@ -18,7 +24,6 @@ classifiers = [ | |
] | ||
requires-python = '>= 3.6' | ||
requires = [ | ||
'get_version', | ||
'anndata>=0.7.3', | ||
'scanpy>=1.5.1', | ||
'pandas>=0.21', | ||
|
@@ -31,11 +36,15 @@ requires = [ | |
'networkx', | ||
'squarify', | ||
'airr', | ||
'tqdm>=4.29.1' # See https://github.com/icbi-lab/scirpy/issues/128#issuecomment-632646608 | ||
'tqdm>=4.29.1', # See https://github.com/icbi-lab/scirpy/issues/128#issuecomment-632646608 | ||
# for getting the version | ||
'setuptools_scm', | ||
'pytoml', | ||
'importlib_metadata>=0.7; python_version < "3.8"' | ||
] | ||
|
||
[tool.flit.metadata.requires-extra] | ||
optional = [ | ||
rpack = [ | ||
'rectangle-packer', | ||
] | ||
test = [ | ||
|
@@ -45,8 +54,8 @@ test = [ | |
doc = [ | ||
'sphinx>=3.0.1,<3.1', | ||
'sphinx_autodoc_typehints>=1.8.0', | ||
'scanpydoc>=0.5', | ||
'sphinx_rtd_theme>=0.4', | ||
'scanpydoc>=0.4.5', | ||
'typing_extensions; python_version < "3.8"', # for `Literal` | ||
# for tutorial | ||
'leidenalg', | ||
|
@@ -57,3 +66,6 @@ doc = [ | |
'jupyter_client', | ||
'ipykernel', | ||
] | ||
|
||
[tool.flit.metadata.urls] | ||
Documentation = 'https://icbi-lab.github.io/scirpy/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
"""Python library for single-cell TCR analysis""" | ||
from get_version import get_version | ||
|
||
__version__ = get_version(__file__) | ||
del get_version | ||
from ._metadata import __version__, __author__, __email__, within_flit | ||
|
||
__author__ = ", ".join(["Gregor Sturm", "Tamas Szabo"]) | ||
|
||
from scanpy import AnnData, read_h5ad | ||
from . import io | ||
from . import util | ||
from . import _preprocessing as pp | ||
from . import _tools as tl | ||
from . import _plotting as pl | ||
from . import datasets | ||
if not within_flit(): | ||
from scanpy import AnnData, read_h5ad | ||
from . import io | ||
from . import util | ||
from . import _preprocessing as pp | ||
from . import _tools as tl | ||
from . import _plotting as pl | ||
from . import datasets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""Metadata. Adapted from https://github.com/theislab/scanpy/pull/1374/.""" | ||
import traceback | ||
from pathlib import Path | ||
|
||
here = Path(__file__).parent | ||
|
||
try: | ||
from setuptools_scm import get_version | ||
import pytoml | ||
|
||
proj = pytoml.loads((here.parent / "pyproject.toml").read_text()) | ||
metadata = proj["tool"]["flit"]["metadata"] | ||
|
||
__version__ = get_version(root="..", relative_to=__file__) | ||
__author__ = metadata["author"] | ||
__email__ = metadata["author-email"] | ||
|
||
except (ImportError, LookupError, FileNotFoundError): | ||
from ._compat import pkg_metadata | ||
|
||
metadata = pkg_metadata(here.name) | ||
__version__ = metadata["Version"] | ||
__author__ = metadata["Author"] | ||
__email__ = metadata["Author-email"] | ||
|
||
|
||
def within_flit(): | ||
for frame in traceback.extract_stack(): | ||
if frame.name == "get_docstring_and_version_via_import": | ||
return True | ||
return False |
Oops, something went wrong.