Skip to content

Commit

Permalink
Move to setup.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
bcebere committed Mar 1, 2023
1 parent ed305c2 commit a31578e
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 54 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -r requirements_dev.txt
run: pip install .[testing]
- name: pre-commit validation
run: pre-commit run --files catenets/*
- name: Security checks
Expand Down Expand Up @@ -53,8 +53,7 @@ jobs:
if: ${{ matrix.os == 'macos-latest' }}
- name: Install dependencies
run: |
pip install -r requirements_dev.txt
pip install .
pip install .[testing]
- name: Test with pytest Unix
run: pytest -vvvsx -m "not slow"
if: ${{ matrix.os != 'windows-latest' }}
Expand Down
2 changes: 1 addition & 1 deletion catenets/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.2"
__version__ = "0.2.3"
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[build-system]
# AVOID CHANGING REQUIRES: IT WILL BE UPDATED BY PYSCAFFOLD!
requires = ["setuptools>=46.1.0", "wheel"]
build-backend = "setuptools.build_meta"
11 changes: 0 additions & 11 deletions requirements.txt

This file was deleted.

10 changes: 0 additions & 10 deletions requirements_dev.txt

This file was deleted.

106 changes: 106 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
[metadata]
name = catenets
author = Alicia Curth
author_email = [email protected]
description = Conditional Average Treatment Effect Estimation Using Neural Networks
license = BSD-3-Clause
license_files = LICENSE
long_description = file: README.md
long_description_content_type = text/markdown; charset=UTF-8
# Add here related links, for example:
# Change if running only on Windows, Mac or Linux (comma-separated)
platforms = any

# Add here all kinds of additional classifiers as defined under
# https://pypi.org/classifiers/
classifiers =
Programming Language :: Python :: 3
Topic :: Scientific/Engineering :: Artificial Intelligence
Intended Audience :: Science/Research
Operating System :: OS Independent

[options]
zip_safe = False
packages = find_namespace:
include_package_data = True
package_dir =
=.

python_requires = >=3.7

install_requires =
gdown
jax>=0.3.16
jaxlib>=0.3.14; sys_platform != 'win32'
loguru>=0.5.3
numpy>=1.20
pandas>=1.3
pytest>=6.2.4
requests
scikit_learn>=0.24.2
scipy>=1.2
torch>=1.9
importlib-metadata; python_version<"3.8"


[options.packages.find]
where = .
exclude =
tests

[options.extras_require]
# Add here test requirements (semicolon/line-separated)
testing =
bandit
black
catboost
flake8
pre-commit
pytest
sklearn
xgboost
setuptools
pytest
pytest-cov
jupyter
notebook
py # pytest 7.2.0 bug https://github.com/pytest-dev/pytest-xprocess/issues/110

[tool:pytest]
addopts =
--verbose
norecursedirs =
dist
build
.tox
testpaths = tests
# Use pytest markers to select/deselect specific tests
markers =
slow: mark tests as slow (deselect with '-m "not slow"')

[devpi:upload]
# Options for the devpi: PyPI server and packaging tool
# VCS export must be deactivated since we are using setuptools-scm
no_vcs = 1
formats = bdist_wheel

[flake8]
# Some sane defaults for the code style checker flake8
max_line_length = 88
extend_ignore = E203, W503
# ^ Black-compatible
# E203 and W503 have edge cases handled by black
exclude =
.tox
build
dist
.eggs
docs/conf.py

[pyscaffold]
# PyScaffold's parameters when the project was created.
# This will be used when updating. Do not change!
version = 4.1.1
package = catenets
extensions =
pre_commit
48 changes: 19 additions & 29 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# stdlib
import os
import re

import setuptools
# third party
from setuptools import setup

PKG_DIR = os.path.dirname(os.path.abspath(__file__))


def read(fname: str) -> str:
return open(os.path.join(os.path.dirname(__file__), fname)).read()


def find_version() -> str:
version_file = read("catenets/version.py")
version_file = read("catenets/version.py").split("\n")[0]
version_re = r"__version__ = \"(?P<version>.+)\""
version_raw = re.match(version_re, version_file)

Expand All @@ -20,30 +24,16 @@ def find_version() -> str:
return version


with open("README.md", "r") as fh:
long_description = fh.read()

with open("requirements.txt") as fp:
install_requires = fp.read()


setuptools.setup(
name="catenets",
version=find_version(),
author="Alicia Curth",
author_email="[email protected]",
description="Conditional Average Treatment Effect Estimation Using Neural Networks",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/vanderschaarlab/mlforhealthlabpub/tree/main/alg/CATENets",
license="BSD-3-Clause",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Intended Audience :: Healthcare Industry",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
],
install_requires=install_requires,
)
if __name__ == "__main__":
try:
setup(
version=find_version(),
)
except: # noqa
print(
"\n\nAn error occurred while building the project, "
"please ensure you have the most updated version of setuptools, "
"setuptools_scm and wheel with:\n"
" pip install -U setuptools setuptools_scm wheel\n\n"
)
raise

0 comments on commit a31578e

Please sign in to comment.