Skip to content

Commit

Permalink
updated the setup tool
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak7376 committed Jun 11, 2024
1 parent b0a0657 commit f5db983
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 116 deletions.
63 changes: 0 additions & 63 deletions Jenkinsfile

This file was deleted.

2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include README.md
include requirements.txt
4 changes: 4 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pytest>=6.0.0
pytest-cov>=2.10.0
coverage>=5.0
flake8>=3.8.0
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=42", "wheel", "numpy"]
build-backend = "setuptools.build_meta"
1 change: 0 additions & 1 deletion requirements-dev.txt

This file was deleted.

1 change: 1 addition & 0 deletions robustbase/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '3.0.4+5.git.gb0a0657'
56 changes: 56 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[metadata]
name = robustbase
version = attr: robustbase.version.__version__
description = A Python Based Library to Calculate Estimators (Sn, Qn, MAD, IQR)
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/deepak7376/robustbase
author = Deepak Yadav
author_email = dky.united@gmail.com
license = MIT
classifiers =
Development Status :: 3 - Alpha
Intended Audience :: Developers
Topic :: Scientific/Engineering :: Mathematics
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
keywords = robust statistics robustness Sn Qn MAD IQR

[options]
packages = find:
include_package_data = true
python_requires = >=3.0
install_requires =
certifi>=2019.11.28
docutils>=0.15.2
numpy>=1.18.0
statistics>=1.0.3.5

[options.packages.find]
where = robustbase

[options.extras_require]
dev =
pytest>=6.0.0
pytest-cov>=2.10.0
coverage>=5.0
flake8>=3.8.0

[flake8]
max-line-length = 88
exclude =
.git,
__pycache__,
dist,
build,
.tox

[tool:pytest]
addopts = --cov=robustbase --cov-report=term-missing

[aliases]
test = pytest
58 changes: 7 additions & 51 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from setuptools import setup, find_packages
from setuptools import setup
import subprocess
import os

# Get version from git
version = (
subprocess.run(["git", "describe", "--tags"], stdout=subprocess.PIPE)
.stdout.decode("utf-8")
Expand All @@ -13,59 +14,14 @@
# pip has gotten strict with version numbers
# so change it to: "1.3.3+22.git.gdf81228"
# See: https://peps.python.org/pep-0440/#local-version-segments
v,i,s = version.split("-")
v, i, s = version.split("-")
version = v + "+" + i + ".git." + s

assert "-" not in version
assert "." in version

assert os.path.isfile("version.py")
with open("VERSION", "w", encoding="utf-8") as fh:
fh.write("%s\n" % version)
# Write the version to a file (this can be used in your package)
with open(os.path.join("robustbase", "version.py"), "w", encoding="utf-8") as fh:
fh.write("__version__ = '{}'\n".format(version))


# reading long description from file
with open('README.md', encoding='utf-8') as f:
long_description = f.read()


# some more details
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Scientific/Engineering :: Mathematics',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
]

# calling the setup function
setup(
name='robustbase',
version=version,
description='A Python Based Library to Calculate Estimators (Sn, Qn, MAD, IQR)',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/deepak7376/robustbase',
author='Deepak Yadav',
author_email='dky.united@gmail.com',
license='MIT',
packages=find_packages('robustbase'), # Include all packages in the new version
include_package_data=True,
package_dir={'': 'robustbase'},
project_urls={
'Source': 'https://github.com/deepak7376/robustbase',
'Tracker': 'https://github.com/deepak7376/robustbase/issues',
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
keywords='robust statistics robustness Sn Qn MAD IQR',
python_requires='>=3.0',
)
setup()
24 changes: 24 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[tox]
envlist = py37, py38, py39, flake8

[testenv]
deps =
-rrequirements.txt
-rdev-requirements.txt
setenv =
PYTHONPATH = {toxinidir}
commands =
pytest --cov=robustbase --cov-report=term-missing

[testenv:flake8]
deps = flake8
commands = flake8 robustbase tests

[flake8]
max-line-length = 88
exclude =
.git,
__pycache__,
dist,
build,
.tox
1 change: 0 additions & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os


def string():
try:
with open(os.path.dirname(__file__) + "/VERSION", "r", encoding="utf-8") as fh:
Expand Down

0 comments on commit f5db983

Please sign in to comment.