diff --git a/.github/workflows/test_main.yml b/.github/workflows/test_main.yml index d2803a5..9cd4491 100644 --- a/.github/workflows/test_main.yml +++ b/.github/workflows/test_main.yml @@ -1,20 +1,21 @@ -name: Python package +name: Tests -on: [push] +on: + push: + pull_request: jobs: build: - runs-on: ubuntu-latest strategy: max-parallel: 4 matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -36,7 +37,7 @@ jobs: pytest --cov=./ --cov-report=xml - name: Upload coverage to Codecov if: matrix.python-version == '3.8' - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.xml diff --git a/.github/workflows/test_pull_requests.yml b/.github/workflows/test_pull_requests.yml deleted file mode 100644 index b14cc41..0000000 --- a/.github/workflows/test_pull_requests.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Python package - -on: [pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - max-parallel: 4 - matrix: - python-version: [3.6, 3.7, 3.8, 3.9] - - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -e . - pip install -r requirements_dev.txt - - name: Lint with flake8 - run: | - pip install flake8 - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pip install pytest - pip install pytest-cov - pytest --cov=./ --cov-report=xml - - name: Upload coverage to Codecov - if: matrix.python-version == '3.8' - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml - flags: unittests - name: codecov-umbrella - yml: ./codecov.yml - fail_ci_if_error: true diff --git a/README.md b/README.md new file mode 100644 index 0000000..cfb7f25 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# space + +[![PyPI](https://img.shields.io/pypi/v/space)](https://pypi.python.org/pypi/space) +[![Tests](https://github.com/LaboratoryOfPlasmaPhysics/space/actions/workflows/test_main.yml/badge.svg)](https://github.com/LaboratoryOfPlasmaPhysics/space/actions/workflows/test_main.yml) +[![Documentation Status](https://readthedocs.org/projects/space/badge/?version=latest)](https://space.readthedocs.io/en/latest/?badge=latest) +[![Coverage Status](https://codecov.io/gh/LaboratoryOfPlasmaPhysics/space/branch/main/graph/badge.svg?branch=main)](https://codecov.io/gh/LaboratoryOfPlasmaPhysics/space/branch/main) + +Space Plasma Analysis CodE + +![space](https://user-images.githubusercontent.com/3200931/98716891-978e2180-238c-11eb-9487-07c66221e5bb.png) + + +* Free software: GNU General Public License v3 +* Documentation: https://space.readthedocs.io. + + +## Features + + +## TODO + +## Credits + + +This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) project template. diff --git a/README.rst b/README.rst deleted file mode 100644 index 0fa27a4..0000000 --- a/README.rst +++ /dev/null @@ -1,43 +0,0 @@ -===== -space -===== - - -.. image:: https://img.shields.io/pypi/v/space.svg - :target: https://pypi.python.org/pypi/space - -.. image:: https://img.shields.io/travis/nicolasaunai/space.svg - :target: https://travis-ci.com/nicolasaunai/space - -.. image:: https://readthedocs.org/projects/space/badge/?version=latest - :target: https://space.readthedocs.io/en/latest/?badge=latest - :alt: Documentation Status - -.. image:: https://codecov.io/gh/LaboratoryOfPlasmaPhysics/space/branch/main/graph/badge.svg?branch=main - :target: https://codecov.io/gh/LaboratoryOfPlasmaPhysics/space/branch/main - :alt: Coverage Status - - - -Space Plasma Analysis CodE - -.. image:: https://user-images.githubusercontent.com/3200931/98716891-978e2180-238c-11eb-9487-07c66221e5bb.png - - - -* Free software: GNU General Public License v3 -* Documentation: https://space.readthedocs.io. - - -Features --------- - -* TODO - -Credits -------- - -This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template. - -.. _Cookiecutter: https://github.com/audreyr/cookiecutter -.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..af7b67a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +[build-system] +build-backend = "flit_core.buildapi" +requires = ["flit_core"] + +[project] +name = "space" +version = "0.1.0" +description = "Space Plasma Analysis CodE" +keywords = ["space", "plasma-physics"] +authors = [ + { name = "Nicolas Aunai", email = "nicolas.aunai@lpp.polytechnique.fr" } +] + +maintainers = [ + { name = "Nicolas Aunai", email = "nicolas.aunai@lpp.polytechnique.fr" } +] + +requires-python = ">=3.8" +license = { file = "LICENSE" } +readme = "README.md" +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Physics", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +dependencies = ["pandas", "numpy", "matplotlib", "scipy"] +[project.urls] +homepage = "https://github.com/LaboratoryOfPlasmaPhysics/space" + + diff --git a/requirements_dev.txt b/requirements_dev.txt index 72c2ca6..bec9ff6 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,12 +1,8 @@ -pip==19.2.3 -bump2version==0.5.11 -wheel==0.33.6 -watchdog==0.9.0 -flake8==3.7.8 -tox==3.14.0 -coverage==4.5.4 -Sphinx==1.8.5 -twine==1.14.0 +bump2version +flake8 +tox +coverage +Sphinx ddt pandas diff --git a/setup.cfg b/setup.cfg index 8593969..efa50fb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,9 +3,9 @@ current_version = 0.1.0 commit = True tag = True -[bumpversion:file:setup.py] -search = version='{current_version}' -replace = version='{new_version}' +[bumpversion:file:pyproject.toml] +search = version = "{current_version}" +replace = version = "{new_version}" [bumpversion:file:space/__init__.py] search = __version__ = '{current_version}' diff --git a/setup.py b/setup.py deleted file mode 100644 index a2777fb..0000000 --- a/setup.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python - -"""The setup script.""" - -from setuptools import setup, find_packages - -with open('README.rst') as readme_file: - readme = readme_file.read() - -with open('HISTORY.rst') as history_file: - history = history_file.read() - -requirements = ['pandas', 'numpy', 'matplotlib', 'scipy'] - -setup_requirements = [] - -test_requirements = [] - -setup( - author="Nicolas Aunai", - author_email='nicolas.aunai@lpp.polytechnique.fr', - python_requires='>=3.5', - classifiers=[ - 'Development Status :: 2 - Pre-Alpha', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', - 'Natural Language :: English', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - ], - description="Space Plasma Analysis CodE", - install_requires=requirements, - license="GNU General Public License v3", - long_description=readme + '\n\n' + history, - include_package_data=True, - keywords='space', - name='space', - packages=find_packages(include=['space', 'space.*']), - setup_requires=setup_requirements, - test_suite='tests', - tests_require=test_requirements, - url='https://github.com/nicolasaunai/space', - version='0.1.0', - zip_safe=False, -) diff --git a/tox.ini b/tox.ini index bf600bf..3785d2c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,17 +1,20 @@ [tox] -envlist = py35, py36, py37, py38, flake8 +envlist = py38, py39, py310, py311, py312, flake8 +isolated_build = True [travis] python = + 3.12: py312 + 3.11: py311 + 3.10: py310 + 3.9: py39 3.8: py38 - 3.7: py37 - 3.6: py36 - 3.5: py35 [testenv:flake8] basepython = python deps = flake8 -commands = flake8 space tests +commands = flake8 space --count --select=E9,F63,F7,F82 --show-source --statistics + [testenv] setenv =