Skip to content

Commit

Permalink
Merge branch 'master' into maintenance_update_TRAINING_integration_te…
Browse files Browse the repository at this point in the history
…st_diffuse
  • Loading branch information
HealthyPear authored Mar 17, 2021
2 parents 4effff2 + 2667706 commit c5be211
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 16 deletions.
8 changes: 7 additions & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@ change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add
template: |
## Summary
...
## Contributors
$CONTRIBUTORS
## What is changed since $PREVIOUS_TAG
Pull-requests containing changes of multiple nature are repeated.
$CHANGES
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:

steps:
- uses: actions/checkout@v2
# make sure we have version info
- run: git fetch --tags
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand Down Expand Up @@ -49,7 +49,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --tags
with:
fetch-depth: 0

- uses: ammaraskar/sphinx-action@master
with:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CD

on:
push:
tags:
- 'v*'

jobs:
deployment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# make sure we have version info
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python --version
pip install -U pip setuptools wheel
python setup.py sdist
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 3 additions & 1 deletion protopipe/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = "0.4.0.post1"
from .version import __version__

__all__ = ['__version__']
9 changes: 9 additions & 0 deletions protopipe/_dev_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Try to use setuptools_scm to get the current version; this is only used
# in development installations from the git repository.
# see protopipe/version.py for details
try:
from setuptools_scm import get_version

version = get_version(root="..", relative_to=__file__)
except Exception as e:
raise ImportError(f"setuptools_scm broken or not installed: {e}")
20 changes: 20 additions & 0 deletions protopipe/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# same as for ctapipe

try:
try:
from ._dev_version import version
except ImportError:
from ._version import version
except Exception:
import warnings

warnings.warn(
"Could not determine protopipe version; this indicates a broken installation."
" Install protopipe from PyPI, using the conda environment or from a local git repository."
" Installing github's autogenerated source release tarballs "
" does not include version information and should be avoided."
)
del warnings
version = "0.0.0"

__version__ = version
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[build-system]
requires = ["setuptools >= 40.6.0", "wheel", "setuptools_scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"

[tool.black]
line-length = 88
target-version = ['py36', 'py37', 'py38']
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
)/
'''
50 changes: 50 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[build_sphinx]
source-dir = docs
build-dir = docs/_build

[upload_docs]
upload-dir = docs/_build/html
show-response = 1

[tool:pytest]
minversion=3.0
norecursedirs=build docs/_build
addopts = -v

[aliases]
test=pytest

[metadata]
name = protopipe
description = Prototype pipeline for the Cherenkov Telescope Array (CTA)
long_description = file: README.rst
author = Dr. Michele Peresano et al.
author_email = michele.peresano@cea.fr
license = CeCILL-B Free Software License Agreement
url = /~https://github.com/cta-observatory/protopipe
edit_on_github = False
github_project = cta-observatory/protopipe

[flake8]
exclude=
build,
docs,
.eggs
max-line-length=90
#ignore=W291,E303,W391,F403,F401,W503,W1202
select = C,E,F,W,B,B950
ignore = E501,W503,E203
per-file-ignores =
*/__init__.py: F401, F403

[pycodestyle]
count = False
ignore = E501,W503,E203
max-line-length = 90
statistics = True

[yapf] # a code reformatter
based_on_style: pep8
dedent_closing_brackets: true
coalesce_brackets: true
join_multiple_lines: true
41 changes: 30 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import os
from setuptools import setup, find_packages
from protopipe import __version__


def readme():
with open("README.rst") as f:
return f.read()


extras_require = {
"docs": [
Expand Down Expand Up @@ -34,20 +28,45 @@ def readme():

setup(
name="protopipe",
version=__version__,
description="Prototype pipeline for the Cherenkov Telescope Array (CTA)",
keywords='cta pipeline simulations grid',
url="/~https://github.com/cta-observatory/protopipe",
project_urls={
'Documentation': 'https://cta-observatory.github.io/protopipe/',
'Source': '/~https://github.com/cta-observatory/protopipe',
'Tracker': '/~https://github.com/cta-observatory/protopipe/issues',
'Projects': '/~https://github.com/cta-observatory/protopipe/projects'
},
author="Michele Peresano",
author_email="michele.peresano@cea.fr",
license="MIT",
license="CeCILL-B Free Software License Agreement",
packages=find_packages(),
package_data={"protopipe": ["aux/example_config_files/protopipe/analysis.yaml"]},
package_data={"protopipe": ["aux/example_config_files/analysis.yaml"]},
include_package_data=True,
install_requires=["ctapipe==0.9.1", "pyirf"],
zip_safe=False,
use_scm_version={"write_to": os.path.join("protopipe", "_version.py")},
tests_require=extras_require["tests"],
classifiers=[
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Astronomy',
'Topic :: Scientific/Engineering :: Physics',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
python_requires='>=3.7',
extras_require={
"all": extras_require["all"],
"all": extras_require["tests"] + extras_require["docs"],
"tests": extras_require["tests"],
"docs": extras_require["docs"],
},
entry_points={
'console_scripts': [
'protopipe-TRAINING=protopipe.scripts.data_training:main',
'protopipe-MODEL=protopipe.scripts.build_model:main',
'protopipe-DL2=protopipe.scripts.write_dl2:main',
'protopipe-DL3-EventDisplay=protopipe.scripts.make_performance_EventDisplay:main',
],
},
)

0 comments on commit c5be211

Please sign in to comment.