Skip to content

Commit

Permalink
build: adding setup.py and changing to src layout (#3)
Browse files Browse the repository at this point in the history
* adding setup.py
* adopting src layout
* testing installed package in CI
  • Loading branch information
alexander-held committed May 7, 2020
1 parent 7f447fe commit 3f0049b
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/CI.yml
Expand Up @@ -24,7 +24,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install flake8 black
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand All @@ -35,7 +34,10 @@ jobs:
run: |
black --check --diff --verbose .
- name: Test example
- name: Install cabinetry and test example
run: |
pip install .
# install extra dependencies the example needs
pip install matplotlib uproot
python util/create_histograms.py
python example.py
10 changes: 10 additions & 0 deletions .gitignore
@@ -1,6 +1,16 @@
__pycache__
*.pyc

# packaging
*.egg-info
dist
build

# editors
.vscode
*.swp

# files produced by running cabinetry
*.root
*.png
*.pdf
Expand Down
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

25 changes: 25 additions & 0 deletions setup.py
@@ -0,0 +1,25 @@
from setuptools import setup, find_packages


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

setup(
name="cabinetry",
version="0.0.1",
author="cabinetry developers",
description="design and steer profile likelihood fits",
long_description=long_description,
long_description_content_type="text/markdown",
license="BSD 3-Clause",
url="https://github.com/alexander-held/cabinetry",
packages=find_packages(where="src"),
package_dir={"": "src"},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
],
python_requires=">=3.6",
install_requires=["numpy", "pyyaml"],
)
2 changes: 2 additions & 0 deletions cabinetry/__init__.py → src/cabinetry/__init__.py
Expand Up @@ -2,3 +2,5 @@
from . import template_builder
from . import template_postprocessor
from . import visualize

__version__ = "0.0.1"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3f0049b

Please sign in to comment.