diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc84415..f6d9eb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: fetch-depth: 0 - name: Prepare mamba installation - if: matrix.install-method == 'mamba' + if: matrix.install-method == 'mamba' && contains(github.event.pull_request.labels.*.name, 'documentation-only') == false env: PYTHON_VERSION: ${{ matrix.python-version }} run: | @@ -47,15 +47,21 @@ jobs: sed -i -e "s/- python.*/- python=$PYTHON_VERSION/g" environment.yml - name: mamba setup - if: matrix.install-method == 'mamba' + if: matrix.install-method == 'mamba' && contains(github.event.pull_request.labels.*.name, 'documentation-only') == false uses: mamba-org/setup-micromamba@v1 + with: + environment-file: environment.yml + cache-downloads: true - name: Install dependencies + env: + PYTHON_VERSION: ${{ matrix.python-version }} run: | python --version pip install pytest-cov restructuredtext-lint pytest-xdist 'coverage!=6.3.0' - pip install .[all] + pip install -e .[all] pip freeze + pip list - name: List installed package versions (conda) if: matrix.environment-type == 'mamba' @@ -63,7 +69,7 @@ jobs: - name: Tests run: | - py.test --cov --cov-report=xml + pytest --cov --cov-report=xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 diff --git a/docs/changes/35.maintenance.rst b/docs/changes/35.maintenance.rst new file mode 100644 index 0000000..598cc4f --- /dev/null +++ b/docs/changes/35.maintenance.rst @@ -0,0 +1 @@ +- switch from setup.py to pyproject.toml diff --git a/environment.yml b/environment.yml index 6e2c2d4..b62bdda 100644 --- a/environment.yml +++ b/environment.yml @@ -1,4 +1,4 @@ ---- +# A conda environment with all useful packages for pyvisgen developers name: pyvisgen channels: - pytorch @@ -6,9 +6,13 @@ channels: - conda-forge dependencies: - python + - astropy<=6.1.0 - pytorch - numpy + - matplotlib - pip - - pip: - - towncrier - - -e . + - towncrier + - jupyter + - pytest + - pytest-cov + - pytest-runner diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8b0211f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,94 @@ +[build-system] +requires = ["setuptools>=64", "setuptools_scm[toml]>=8"] +build-backend = "setuptools.build_meta" + +[project] +name = "pyvisgen" +version = "0.2.0" +description = "Simulate radio interferometer observations and visibility generation with the RIME formalism." +readme = "README.md" +authors = [ + {name = "Kevin Schmidt, Felix Geyer, Stefan Fröse"}, +] +maintainers = [ + {name = "Kevin Schmidt", email = "kevin3.schmidt@tu-dortmund.de"}, + {name = "Felix Geyer", email = "felix.geyer@tu-dortmund.de"}, +] +license = {text = "MIT"} +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Scientific/Engineering :: Astronomy", + "Topic :: Scientific/Engineering :: Physics", + "Topic :: Scientific/Engineering :: Information Analysis", + "Development Status :: 4 - Beta", +] + +requires-python = ">=3.10" + +dependencies = [ + "numpy", + "astropy<=6.1.0", + "torch", + "matplotlib", + "ipython", + "scipy", + "pandas", + "toml", + "pytest", + "pytest-cov", + "jupyter", + "astroplan", + "torch", + "tqdm", + "numexpr", + "click", + "h5py", + "natsort", + "pre-commit", +] + +[project.scripts] + pyvisgen_create_dataset = "pyvisgen.simulation.scripts.create_dataset:main" + +[tool.setuptools.packages.find] + where = ["pyvisgen"] + +[tool.towncrier] + package = "ctapipe" + directory = "docs/changes" + filename = "CHANGES.rst" + template = "docs/changes/template.rst" + # let towncrier create proper links to the merged PR + issue_format = "`#{issue} `__" + + [tool.towncrier.fragment.feature] + name = "New Features" + showcontent = true + + [tool.towncrier.fragment.bugfix] + name = "Bug Fixes" + showcontent = true + + [tool.towncrier.fragment.api] + name = "API Changes" + showcontent = true + + [tool.towncrier.fragment.datamodel] + name = "Data Model Changes" + showcontent = true + + [tool.towncrier.fragment.optimization] + name = "Refactoring and Optimization" + showcontent = true + + [tool.towncrier.fragment.maintenance] + name = "Maintenance" + showcontent = true + + [[tool.towncrier.section]] + name = "" + path = "" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 20ce0d7..0000000 --- a/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[aliases] -test=pytest - -[tool:pytest] -addopts = -v diff --git a/setup.py b/setup.py deleted file mode 100644 index c8533a7..0000000 --- a/setup.py +++ /dev/null @@ -1,57 +0,0 @@ -from setuptools import find_packages, setup - -setup( - name="pyvisgen", - version="0.2.0", - description="Simulate radio interferometer observations \ - and visibility generation with the RIME formalism.", - url="https://github.com/radionets-project/pyvisgen", - author="Kevin Schmidt, Felix Geyer, Stefan Fröse", - author_email="kevin3.schmidt@tu-dortmund.de", - license="MIT", - include_package_data=True, - packages=find_packages(), - install_requires=[ - "numpy", - "astropy", - "matplotlib", - "ipython", - "scipy", - "pandas", - "toml", - "pytest", - "pytest-cov", - "jupyter", - "astroplan", - "torch", - "tqdm", - "numexpr", - "click", - "h5py", - "natsort", - "pre-commit", - ], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - zip_safe=False, - entry_points={ - "console_scripts": [ - "pyvisgen_create_dataset = pyvisgen.simulation.scripts.create_dataset:main", - ], - }, - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3 :: Only", - "Topic :: Scientific/Engineering :: Astronomy", - "Topic :: Scientific/Engineering :: Physics", - "Topic :: Scientific/Engineering :: Information Analysis", - ], -) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29