-
Notifications
You must be signed in to change notification settings - Fork 7
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 #8 from Ensembl/setup_pyproject
toying with setuptools
- Loading branch information
Showing
9 changed files
with
148 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
**/__pycache__ | ||
**/*.egg-info | ||
**/pip-wheel-metadata | ||
**/build |
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 |
---|---|---|
|
@@ -8,3 +8,49 @@ A set of ehive pipelines: | |
|
||
The files are in various formats (fasta, gff3, json) following BRC4 specifications. | ||
|
||
## Get repo and install | ||
|
||
``` | ||
git clone [email protected]:Ensembl/ensembl-genomio.git | ||
pip install ./ensembl-genomio | ||
# test | ||
python -c 'import ensembl.brc4.runnable.read_json' | ||
``` | ||
|
||
Update your perl envs (if you need to) | ||
``` | ||
export PERL5LIB=$(pwd)/ensembl-genomio/lib/perl:$PERL5LIB | ||
export PATH=$(pwd)/ensembl-genomio/scripts:$PATH | ||
``` | ||
|
||
### Optional installation | ||
If you need to install "editable" python package use '-e' option | ||
``` | ||
pip install -e ./ensembl-genomio | ||
``` | ||
|
||
To install additional dependencies (e.g. `[doc]` or `[dev]`) provide `[<tag>]` string. I.e. | ||
``` | ||
pip install -e ./ensembl-genomio[dev] | ||
``` | ||
|
||
For the list of tags see `[project.optional-dependencies]` in [pyproject.toml](./pyproject.toml). | ||
|
||
### Docs generation | ||
Install python part with the `[doc]` or `[dev]` tag. | ||
Change into repo dir | ||
Run doc build script. | ||
|
||
``` | ||
git clone [email protected]:Ensembl/ensembl-genomio.git | ||
pip install -e ./ensembl-genomio[doc] | ||
cd ./ensembl-genomio | ||
# build docs | ||
./scripts/setup/docs/build_sphinx_docs.sh | ||
``` | ||
|
||
|
||
|
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,95 @@ | ||
# See the NOTICE file distributed with this work for additional information | ||
# regarding copyright ownership. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# pyproject.toml -- Ensembl GenomIO project configuration | ||
|
||
[build-system] | ||
requires = [ | ||
"setuptools", | ||
"setuptools-scm", | ||
"wheel" | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
|
||
## Generic configuration | ||
[project] | ||
name = "ensembl-genomio" | ||
version = "0.1" # should be assigned dynamically in the future | ||
requires-python = ">= 3.7" | ||
|
||
description = "Ensembl GenomIO -- pipelines to convert basic genomic data into Ensembl cores and back to flatfile" | ||
readme = "README.md" | ||
|
||
authors = [ { name = "Ensembl", email = "[email protected]" } ] | ||
license = { text = "Apache License 2.0" } | ||
# for urls see [project.urls] below | ||
|
||
keywords = [ | ||
"genome_io", | ||
"ensembl", | ||
"bioinformatics", | ||
"annotation", | ||
"setup", | ||
] | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Environment :: Console", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Natural Language :: English", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Topic :: Scientific/Engineering :: Bio-Informatics", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
|
||
dependencies = [ | ||
"bcbio-gff >= 0.6.6", | ||
"biopython >= 1.79", | ||
"jsonschema >= 4.6.0", | ||
"intervaltree >= 3.1.0", | ||
"mysql-connector-python >= 8.0.29", | ||
"python-redmine >= 2.3.0", | ||
"requests >= 2.28.0", | ||
] # see [project.optional-dependencies] for dev dependencies | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"mock", | ||
"Sphinx", | ||
"toml-validator", | ||
] | ||
|
||
doc = [ | ||
"mock", | ||
"Sphinx", | ||
] | ||
|
||
|
||
[project.urls] | ||
homepage = "https://www.ensembl.org" | ||
repository = "https://github.com/Ensembl/ensembl-genomio" | ||
|
||
|
||
## `setuptools` related section | ||
[tool.setuptools] | ||
package-dir = {"" = "lib/python"} | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["lib/python"] # list of folders that contain the packages (["."] by default) | ||
|
||
# For additional information on `setuptools` configuration see | ||
# https://setuptools.pypa.io/en/latest/userguide/quickstart.html | ||
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html | ||
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -12,44 +12,10 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Build script for setuptools.""" | ||
import sys | ||
"""setuptools based stub for the "editable" installations""" | ||
|
||
from setuptools import setup, find_namespace_packages | ||
from setuptools import setup | ||
|
||
with open('README.md') as f: | ||
readme = f.read() | ||
if __name__ == "__main__": | ||
setup() | ||
|
||
with open('VERSION') as f: | ||
version = f.read() | ||
|
||
def import_requirements(requirements_path): | ||
"""Import file located at the root of the repository.""" | ||
with open(requirements_path) as file: | ||
return [line.rstrip() for line in file.readlines()] | ||
setup( | ||
name='ensembl-genomio', | ||
version=version, | ||
packages=find_namespace_packages(where='lib/python'), | ||
package_dir={"": "lib/python"}, | ||
description="Ensembl Genome IO", | ||
include_package_data=True, | ||
install_requires=import_requirements('requirements.txt'), | ||
long_description=readme, | ||
author='Ensembl', | ||
author_email='[email protected]', | ||
url='https://www.ensembl.org', | ||
download_url='https://github.com/Ensembl/ensembl-genomio', | ||
license="Apache License 2.0", | ||
python_requires=">=3.7", | ||
classifiers=[ | ||
"Development Status :: 3 - Alpha", | ||
"Environment :: Console", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Natural Language :: English", | ||
"Programming Language :: Python :: 3.7", | ||
"Topic :: Scientific/Engineering :: Bio-Informatics", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
) |