Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve setup and change source code layout to comply with PEP-660. #32

Merged
merged 8 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ _version.py
__pycache__

# ignore version cache file (generated automatically when setup.py is run)
ctapipe/_version_cache.py
src/ctapipe_io_nectarcam/_version_cache.py

# Ignore .c files by default to avoid including generated code. If you want to
# add a non-generated .c extension, use `git add -f filename.c`.
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
[![Build Status](https://travis-ci.org/cta-observatory/ctapipe_io_nectarcam.svg?branch=master)](https://travis-ci.org/cta-observatory/ctapipe_io_nectarcam)
[![CI](https://github.com/cta-observatory/ctapipe_io_nectarcam/workflows/CI/badge.svg?branch=master)](https://github.com/cta-observatory/ctapipe_io_nectarcam/actions?query=workflow%3ACI+branch%3Amaster)

EventSource Plugin for ctapipe, able to read NectarCam zfits files
and calibrate them to R1 as needed for ctapipe tools.

To install into an existing environment, just do:
```shell
pip install .
```

For development, create a new environment and run the development install:
```shell
conda env create -n nectar-dev -f environment.yml
conda activate nectar-dev
pip install -e .
```
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ channels:
- conda-forge
- default
dependencies:
- astropy>=4.2
- astropy~=4.2
- python=3.8 # nail the python version, so conda does not try upgrading / dowgrading
- ctapipe=0.12
- eventio
Expand All @@ -14,6 +14,7 @@ dependencies:
- numpy=1.22 # higher versions >=1.23 don't work due to astropy4 dependency in ctapipe0.12
- numpydoc
- pytest
- pytables>=3.7
- pyyaml
- zlib
- pip
Expand Down
56 changes: 55 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,61 @@
[metadata]
name = ctapipe_io_nectarcam
description = ctapipe plugin for reading NectarCam files
long_description = file: README.md
long_description_content_type = text/markdown
long_description_content_type = text/markdown; charset=UTF-8
author = Franca Cassol
author_email = [email protected]
license = MIT

project_urls =
Bug Tracker = https://github.com/cta-observatory/ctapipe_io_nectarcam/issues
Source Code = https://github.com/cta-observatory/ctapipe_io_nectarcam

classifiers =
Development Status :: 3 - Alpha
License :: OSI Approved :: MIT License
Intended Audience :: Science/Research
Topic :: Scientific/Engineering :: Astronomy
Topic :: Scientific/Engineering :: Physics
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8

[options]
packages = find:
package_dir =
= src
python_requires = ~=3.8
zip_safe = False
install_requires =
astropy~=4.2
ctapipe~=0.12
numpy~=1.22
protozfits~=2.0
tables>=3.7

[options.package_data]
* = resources/*

[options.packages.find]
where = src
exclude =
ctapipe_io_nectarcam._dev_version

[options.extras_require]
tests =
pytest
dev =
setuptools_scm[toml]
all =
%(tests)s
%(dev)s

[tool:pytest]
minversion = 3.0
addopts = -v

[aliases]
test = pytest

[flake8]
max-line-length = 88
22 changes: 2 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,2 @@
import os
from setuptools import setup, find_packages


setup(
name='ctapipe_io_nectarcam',
packages=find_packages(exclude=["ctapipe_io_nectarcam._dev_version"]),
use_scm_version={"write_to": os.path.join("ctapipe_io_nectarcam", "_version.py")},
description='ctapipe plugin for reading NectarCam files',
install_requires=[
'astropy~=4.2',
'ctapipe~=0.12',
'numpy~=1.22.4',
'protozfits~=2.0',
'setuptools_scm',
],
author='Franca Cassol',
author_email='[email protected]',
license='MIT',
)
from setuptools import setup
setup()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
try:
from setuptools_scm import get_version

version = get_version(root="../..", relative_to=__file__)
version = get_version(root="..", relative_to=__file__)
except Exception as e:
raise ImportError(f"setuptools_scm broken or not installed: {e}")
File renamed without changes.