diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0b8e2f4..7c0ea4e 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -16,14 +16,15 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - uses: yezz123/setup-uv@v4 - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install tox tox-gh-actions + uv venv + uv pip install -e . # run the tests located in skrf/ - - name: Test the code, tutorials and examples + - name: Test the code if: ${{ always() }} run: | - tox + uv run pytest diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0d3ce17 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,13 @@ +[project] +name = "west-ic-antenna" +version = "0.12.0" +description = "WEST ICRH Antenna Electrical Model" +readme = "README.md" +requires-python = ">=3.11" +dependencies = [ + "ipywidgets>=8.1.5", + "matplotlib>=3.9.2", + "numpy>=2.1.3", + "pytest>=8.3.3", + "scikit-rf>=1.4.1", +] diff --git a/setup.py b/setup.py deleted file mode 100644 index 767d3d1..0000000 --- a/setup.py +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# inspired from from https://github.com/navdeep-G/setup.py/ -import setuptools -from setuptools import find_packages, setup, Command -import io -import os -import sys -import pathlib -from shutil import rmtree - - -# The directory containing this file -HERE = pathlib.Path(__file__).parent - -# The text of the README file -README = (HERE / "README.md").read_text() - -# retrieve version -with open('west_ic_antenna/__init__.py') as fid: - for line in fid: - if line.startswith('__version__'): - VERSION = line.strip().split()[-1][1:-1] - break - -# Note: To use the 'upload' functionality of this file, you must: -# $ pipenv install twine --dev - - -# Package meta-data. -NAME = 'west-ic-antenna' -DESCRIPTION = 'WEST ICRF Antenna RF Model', -URL = 'https://github.com/jhillairet/WEST_IC_antenna' -EMAIL = 'julien.hillairet@gmail.com' -AUTHOR = 'Julien Hillairet' -REQUIRES_PYTHON = '>=3.10.0' - -# What packages are required for this module to be executed? -REQUIRED = [ - 'scikit-rf', 'numpy', 'scipy', 'matplotlib', 'tqdm', 'pandas' , 'ipympl' -] - -# What packages are optional? -EXTRAS = { - # -} - -# The rest you shouldn't have to touch too much :) -# ------------------------------------------------ -# Except, perhaps the License and Trove Classifiers! -# If you do change the License, remember to change the Trove Classifier for that! - -here = os.path.abspath(os.path.dirname(__file__)) - -# Import the README and use it as the long-description. -# Note: this will only work if 'README.md' is present in your MANIFEST.in file! -try: - with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f: - long_description = '\n' + f.read() -except FileNotFoundError: - long_description = DESCRIPTION - -# Load the package's __version__.py module as a dictionary. -about = {} -if not VERSION: - project_slug = NAME.lower().replace("-", "_").replace(" ", "_") - with open(os.path.join(here, project_slug, '__version__.py')) as f: - exec(f.read(), about) -else: - about['__version__'] = VERSION - - -class UploadCommand(Command): - """Support setup.py upload.""" - - description = 'Build and publish the package.' - user_options = [] - - @staticmethod - def status(s): - """Prints things in bold.""" - print('\033[1m{0}\033[0m'.format(s)) - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - try: - self.status('Removing previous builds…') - rmtree(os.path.join(here, 'dist')) - except OSError: - pass - - self.status('Building Source and Wheel (universal) distribution…') - os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable)) - - self.status('Uploading the package to PyPI via Twine…') - os.system('twine upload dist/*') - - self.status('Pushing git tags…') - os.system('git tag v{0}'.format(about['__version__'])) - os.system('git push --tags') - - sys.exit() - - -# Where the magic happens: -setup( - name=NAME, - version=VERSION, - description=DESCRIPTION, - long_description=README, - long_description_content_type='text/markdown', - author=AUTHOR, - author_email=EMAIL, - python_requires=REQUIRES_PYTHON, - url=URL, - packages=find_packages(exclude=["tests", "*.tests", "*.tests.*", "tests.*"]), - # If your package is a single module, use this instead of 'packages': - # py_modules=['mypackage'], - - # entry_points={ - # 'console_scripts': ['mycli=mymodule:cli'], - # }, - install_requires=REQUIRED, - extras_require=EXTRAS, - setup_requires=['setuptools_scm'], - include_package_data=True, - license='MIT', - classifiers=[ - # Trove classifiers - # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy' - ], - # $ setup.py publish support. - cmdclass={ - 'upload': UploadCommand, - }, -) - diff --git a/tox.ini b/tox.ini deleted file mode 100644 index cd8cd44..0000000 --- a/tox.ini +++ /dev/null @@ -1,19 +0,0 @@ -# running 'tox' will run the tests located in west_ic_antenna/ -# running 'tox -- --nbval-lax' will also run all the notebooks located in doc/ -[tox] -isolated_build = True -envlist = py{311, 312} - -[gh-actions] -python = - 3.11: py311 - 3.12: py312 - -# This is the default testsetup with all dependencies installed -[testenv] -deps = - pytest - pytest-xdist -commands = - python -m pytest -n=auto - \ No newline at end of file diff --git a/west_ic_antenna/__init__.py b/west_ic_antenna/__init__.py index 06bd8f9..5a856d3 100644 --- a/west_ic_antenna/__init__.py +++ b/west_ic_antenna/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.11' +__version__ = '0.12.0' from .antenna import * from .topica import TopicaResult diff --git a/west_ic_antenna/test/__init__.py b/west_ic_antenna/test/__init__.py new file mode 100644 index 0000000..e69de29