IAP GITLAB

Skip to content
Snippets Groups Projects
Commit cc68b005 authored by Remy Prechelt's avatar Remy Prechelt Committed by Ralf Ulrich
Browse files

Add empty Python package skeleton.

parent 194d2f2d
No related branches found
No related tags found
1 merge request!256Add basic Python package skeleton.
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# static files generated from Django application using `collectstatic`
media
static
This diff is collapsed.
include README.md LICENSE
recursive-include corsika *
recursive-include scripts *
recursive-include examples *
##
# ##
# corsika
#
# @file
# find python3
PYTHON=`which python3`
# our testing targets
.PHONY: tests flake black isort all
all: mypy isort black flake tests
tests:
${PYTHON} -m pytest --cov=corsika tests
flake:
${PYTHON} -m flake8 corsika
black:
${PYTHON} -m black -t py37 corsika tests
isort:
${PYTHON} -m isort --atomic corsika tests
mypy:
${PYTHON} -m mypy corsika
# end
# Python for CORSIKA8
![License](https://img.shields.io/badge/license-GPL3-blue)
![Python](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-blue)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
## Installation
To install the CORSIKA 8 Python library, you will need Python >= 3.6. The below
instructions are assuming that `python` refers to Python 3.\*. If `python` still
refers to Python 2.\*, please replace `python` with `python3` and `pip` with
`pip3`.
To install this package, change into the `corsika/Python` directory and run
pip install --user -e .
You can verify that the installation was successful by trying to import `corsika`
python -c 'import corsika'
# Running the Tests
If you wish to develop new features in `corsika`, you will also need to install
some additional dependencies so you can run our unit tests. These can be
installed with
pip install --user -e .[test]
Once that is completed, you can run the unit tests directory from the `corsika` directory
python -m pytest tests
"""
(c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
This software is distributed under the terms of the GNU General Public
Licence version 3 (GPL Version 3). See file LICENSE for a full version of
the license.
"""
__version__: str = "8.0.0-alpha"
[flake8]
# use a slightly longer line to be consistent with black
max-line-length = 88
# E231 is missing whitespace after a comma
# this contradicts the black formatting rules
# and therefore creates spurious errors
ignore = E231
# we set various directories we want to exclude
exclude =
# Don't bother checking in cache directories
__pycache__
[isort]
# use parenthesis for multi-line imports
use_parentheses = true
[mypy]
# the primary Python version
python_version = 3.7
# allow returning Any
# this creates excessive errors when using libraries
# that don't have MyPy typing support
warn_return_any = False
# don't allow untyped functions
disallow_untyped_defs = True
# warn if any part of this config is mispelled
warn_unused_configs = True
# warn for missing type information
warn_incomplete_stub = True
# warn us if we don't return from a function explicitly
warn_no_return = True
# use incremental typing to speed things up
incremental = True
# show error contexts
show_error_context = True
# and show the column numbers for errors
show_column_numbers = True
# ignore missing types for setuptools
[mypy-setuptools.*]
ignore_missing_imports = True
# ignore missing types for numpy
[mypy-numpy.*]
ignore_missing_imports = True
# ignore missing types for matplotlib
[mypy-matplotlib.*]
ignore_missing_imports = True
from os import path
from setuptools import setup
# the stereo version
__version__ = "8.0.0-alpha"
# get the absolute path of this project
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
# the standard setup info
setup(
name="corsika",
version=__version__,
description="A Python package for working with CORSIKA 8",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika",
author="CORSIKA 8 Collaboration",
author_email="corsika-devel@lists.kit.edu",
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Physics",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
keywords=["cosmic ray", "physics", "astronomy", "simulation"],
packages=["corsika"],
python_requires=">=3.6*, <4",
install_requires=["numpy", "pyyaml",],
extras_require={
"test": [
"pytest",
"black",
"mypy",
"isort",
"coverage",
"pytest-cov",
"flake8",
],
},
scripts=[],
project_urls={"code": "https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika"},
include_package_data=True,
)
"""
(c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
This software is distributed under the terms of the GNU General Public
Licence version 3 (GPL Version 3). See file LICENSE for a full version of
the license.
"""
import corsika
def test_corsika_version() -> None:
"""
Check the current CORSIKA version.
"""
assert corsika.__version__ == "8.0.0-alpha"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment