-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from Herculens/pr-versioning
Add proper versioning
- Loading branch information
Showing
9 changed files
with
124 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Publish to PyPi | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
build-and-publish: | ||
name: Build python package and publish to PyPi | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel | ||
- name: Build | ||
run: python setup.py sdist bdist_wheel | ||
- name: Publish to PyPi | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Publish to Test PyPi | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
build-and-publish: | ||
name: Build python package and publish to Test PyPi | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel | ||
- name: Build | ||
run: python setup.py sdist bdist_wheel | ||
- name: Publish to Test PyPi | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
__author__ = 'Austin Peel, Aymeric Galan, Giorgos Vernardos and contributors' | ||
""" | ||
This file initializes the coolest module | ||
and provides some basic information about the package. | ||
""" | ||
|
||
# Set the package release version | ||
version_info = (0, 0, 1) | ||
__version__ = '.'.join(str(c) for c in version_info) | ||
|
||
# Set the package details | ||
__author__ = 'Aymeric Galan, Austin Peel, Giorgos Vernardos & Herculens contributors' | ||
__email__ = '[email protected]' | ||
__version__ = '0.0.1' | ||
__credits__ = 'EPFL' | ||
__year__ = '2021-2024' | ||
__credits__ = 'Herculens contributors, EPFL (see AUTHORS.md)' | ||
__url__ = 'https://github.com/austinpeel/herculens' | ||
__description__ = 'Auto-differentiable strong lens modelling' | ||
__license__ = 'MIT' |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,67 @@ | ||
import setuptools | ||
import os | ||
|
||
__name__ = 'herculens' | ||
name = 'herculens' | ||
|
||
release_info = {} | ||
infopath = os.path.abspath(os.path.join(os.path.dirname(__file__), | ||
__name__, 'info.py')) | ||
name, '__init__.py')) | ||
with open(infopath) as open_file: | ||
exec(open_file.read(), release_info) | ||
|
||
this_directory = os.path.abspath(os.path.dirname(__file__)) | ||
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f: | ||
long_description = f.read() | ||
readme = f.read() | ||
|
||
# Use the README as long description but remove the second version | ||
# of the logo (readable only by GitHub's dark mode interface) | ||
long_description = readme.replace('<img src="https://raw.githubusercontent.com/Herculens/herculens/main/images/horizontal_dark_bg.png#gh-dark-mode-only" width="600" alt="Herculens logo" />', '') | ||
|
||
# Python version | ||
python_requires = '>=3.8' | ||
|
||
# Minimal required packages (see requirements.txt for versions) | ||
install_requires = [ | ||
'numpy', | ||
'scipy', | ||
'jax', | ||
'jaxlib', | ||
'objax', | ||
'scikit-image', | ||
# 'https://github.com/aymgal/utax.git', # use requirements.txt | ||
] | ||
|
||
# Minimal optional packages (see requirements.txt for versions and complete list) | ||
install_optional = [ | ||
'matplotlib', # for plotting | ||
'optax', # for optimizers | ||
'jaxopt', # for optimizers | ||
'findiff', # for building matrix with finite difference coefficients | ||
'numpyro', # for SVI and HMC sampling | ||
'blackjax', # for JAX-based HMC sampling | ||
] | ||
|
||
version = release_info['__version__'] | ||
|
||
setuptools.setup( | ||
name=__name__, | ||
name=name, | ||
author=release_info['__author__'], | ||
author_email=release_info['__email__'], | ||
version=release_info['__version__'], | ||
version=version, | ||
url=release_info['__url__'], | ||
download_url=f"https://github.com/Herculens/herculens/archive/refs/tags/v{version}.tar.gz", | ||
packages=setuptools.find_packages(), | ||
python_requires=release_info['__python__'], | ||
install_requires=release_info['__requires__'], | ||
license=release_info['__license__'], | ||
description=release_info['__about__'], | ||
description=release_info['__description__'], | ||
long_description=long_description, | ||
long_description_content_type='text/markdown', | ||
setup_requires=release_info['__setup_requires__'], | ||
tests_require=release_info['__tests_require__'] | ||
keywords=["herculens", "lensing", "gravitation", "astrophysics"], | ||
|
||
python_requires=python_requires, | ||
install_requires=install_requires, | ||
extras_require={ | ||
"opt": install_optional, # installable via `pip install herculens[opt]` | ||
}, | ||
setup_requires=['pytest-runner',], | ||
tests_require=['pytest', 'pytest-cov', 'pytest-pep8'], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
tqdm>=4.61.0 # for progress bars with certain optimizers and samplers | ||
numpyro>=0.10.1 # for SVI and HMC sampling | ||
optax>=0.1.0 # for optimizers | ||
jaxopt>=0.5.5 # for optimizers | ||
matplotlib>=3.7.0 # for plotting | ||
git+https://github.com/adam-coogan/jaxinterp2d@9881075#egg=jaxinterp2d # for fast bilinear interpolation (e.g. for pixelated profiles) | ||
git+https://github.com/Herculens/helens.git@main#egg=helens # lens equation solver |