Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switch to using pyproject.toml (#42) * Switch to using pyproject.toml * Include numpy headers * Start using github actions * Fix linter errors * Use pylint for github actions * Run pylint first * use defined environments on github * Fix call windows issue * Try to run coveralls * Run on pull requests * Upload coverage results in parallel jobs * Bump version number
- Loading branch information
Showing
10 changed files
with
110 additions
and
129 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Python package | ||
|
||
on: ["push", "pull_request"] | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9",] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox | ||
- name: Test with tox | ||
run: tox --skip-missing-interpreters | ||
- name: Coveralls Parallel | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
flag-name: run-${{ join(matrix.*, '-') }} | ||
parallel: true | ||
|
||
finish: | ||
needs: test | ||
if: ${{ always() }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Coveralls Finished | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
parallel-finished: true | ||
carryforward: "run-3.8,run-3.9" |
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
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,40 @@ | ||
[build-system] | ||
requires = ["setuptools>=61.0", "wheel", "Cython", "numpy"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "gamtools" | ||
version = "2.0.1" | ||
authors = [ | ||
{ name="Rob Beagrie", email="rob@beagrie.co.uk"} | ||
] | ||
description = "A package containing some utilities for analyzing GAM data." | ||
license = { file = "LICENSE" } | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Science/Research", | ||
"Topic :: Scientific/Engineering :: Bio-Informatics", | ||
"License :: OSI Approved :: Apache Software License" | ||
] | ||
dependencies = [ | ||
"numpy", | ||
"scipy", | ||
"pandas", | ||
"wrapit>=0.3.0", | ||
"pytest", | ||
"doit==0.29.0; python_version<'3.0'", | ||
"mock; python_version<'3.0'", | ||
"doit>=0.30.0; python_version>='3.0'" | ||
] | ||
|
||
[project.urls] | ||
"Homepage" = "https://gam.tools" | ||
|
||
[project.scripts] | ||
gamtools = 'gamtools.main:main' | ||
create_empty_bedgraph = 'gamtools.utils:empty_bedgraph_from_cmdline' | ||
|
||
[tool.setuptools] | ||
packages = ['gamtools', 'gamtools.qc'] | ||
include-package-data = true | ||
package-dir = {"" = "lib"} |
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,86 +1,16 @@ | ||
import os | ||
import sys | ||
from setuptools import setup, Extension | ||
from setuptools.command.sdist import sdist | ||
from setuptools.command.build_ext import build_ext | ||
|
||
class CustomBuildExtCommand(build_ext): | ||
"""Customized setuptools build_ext command - checks numpy is installed.""" | ||
def run(self): | ||
|
||
# Check numpy is installed before trying to find the location | ||
# of numpy headers | ||
|
||
try: | ||
import numpy | ||
except ImportError: | ||
raise ImportError('numpy need to be installed before GAMtools can be ' | ||
'compiled. Try installing with "pip install numpy" ' | ||
'before installing GAMtools.') | ||
|
||
self.include_dirs.append(numpy.get_include()) | ||
|
||
build_ext.run(self) | ||
|
||
class custom_cythonize_sdist(sdist): | ||
def run(self): | ||
# Make sure the compiled Cython files in the distribution are up-to-date | ||
from Cython.Build import cythonize | ||
cythonize([ | ||
"lib/gamtools/cosegregation_internal.pyx", | ||
"lib/gamtools/mirnylib_numutils_internal.pyx", | ||
], language_level = "3") | ||
sdist.run(self) | ||
|
||
# Utility function to read the README file. | ||
# Used for the long_description. It's nice, because now 1) we have a top level | ||
# README file and 2) it's easier to type in the README file than to put a raw | ||
# string in below ... | ||
def read(fname): | ||
return open(os.path.join(os.path.dirname(__file__), fname)).read() | ||
|
||
from setuptools import Extension, setup | ||
from Cython.Build import cythonize | ||
import numpy | ||
|
||
extensions = [ | ||
Extension('gamtools.cosegregation_internal', | ||
["lib/gamtools/cosegregation_internal.pyx"], | ||
include_dirs=[numpy.get_include()]), | ||
Extension('gamtools.mirnylib_numutils_internal', | ||
["lib/gamtools/mirnylib_numutils_internal.pyx"], | ||
include_dirs=[numpy.get_include()]), | ||
] | ||
|
||
setup( | ||
name = "gamtools", | ||
version = "2.0.0", | ||
author = "Rob Beagrie", | ||
author_email = "rob@beagrie.co.uk", | ||
url = "https://gam.tools", | ||
description = ("A package containing some utilities for analyzing GAM data."), | ||
license = "Apache2.0", | ||
package_dir = {'': 'lib'}, | ||
packages=['gamtools', 'gamtools.qc'], | ||
ext_modules = [Extension('gamtools.cosegregation_internal', | ||
["lib/gamtools/cosegregation_internal.c"]), | ||
Extension('gamtools.mirnylib_numutils_internal', | ||
["lib/gamtools/mirnylib_numutils_internal.c"],), | ||
], | ||
cmdclass = { | ||
'sdist': custom_cythonize_sdist, | ||
'build_ext': CustomBuildExtCommand, | ||
}, | ||
install_requires=[ | ||
'numpy', | ||
'scipy', | ||
'pandas', | ||
'wrapit>=0.3.0', | ||
'pytest'], | ||
extras_require={ | ||
':python_version<"3.0"': ['doit==0.29.0'], | ||
':python_version>="3.0"': ['doit==0.30.0'], | ||
':python_version<"3.0"': ['mock'], | ||
}, | ||
entry_points = { | ||
'console_scripts': [ | ||
'gamtools = gamtools.main:main', | ||
'create_empty_bedgraph = gamtools.utils:empty_bedgraph_from_cmdline', | ||
] | ||
}, | ||
long_description=read('README.md'), | ||
include_package_data=True, | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Science/Research", | ||
"Topic :: Scientific/Engineering :: Bio-Informatics", | ||
"License :: OSI Approved :: Apache Software License", | ||
], | ||
ext_modules = cythonize(extensions, language_level = "3"), | ||
) |
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