-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 'pip install' for pip>=23.1 (#23)
* Fix 'pip install' for pip>=23.1 * adding ci * requirements updated * Activate py3.6 as a reference * Revert the addition. Sorry... * don't use editable mode in pip * Don't use editable mode * Forgot a space * Run test first * Renaming source directory * adding package_dir --------- Co-authored-by: Keisuke Fujii <[email protected]>
- Loading branch information
1 parent
2833398
commit 9f16d03
Showing
11 changed files
with
107 additions
and
37 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,68 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- "*" | ||
workflow_dispatch: # allows you to trigger manually | ||
|
||
jobs: | ||
detect-ci-trigger: | ||
name: detect ci trigger | ||
runs-on: ubuntu-latest | ||
if: | | ||
github.repository == 'fujiisoup/py3nj' | ||
&& (github.event_name == 'push' || github.event_name == 'pull_request') | ||
outputs: | ||
triggered: ${{ steps.detect-trigger.outputs.trigger-found }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
test: | ||
name: Set up python | ||
runs-on: ubuntu-latest | ||
needs: detect-ci-trigger | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
# Bookend python versions | ||
python-version: ["3.8", "3.10"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags. | ||
- name: Set environment variables | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
echo "CONDA_ENV_FILE=ci/requirements/py${{ matrix.python-version }}.yml" >> $GITHUB_ENV | ||
- name: Setup miniconda and install py3nj | ||
run: | | ||
conda env create -n test_env --file $CONDA_ENV_FILE; | ||
source /usr/share/miniconda/etc/profile.d/conda.sh; | ||
conda activate test_env; | ||
conda list; | ||
pip install --no-deps .; | ||
python -m pip install --no-deps . | ||
- name: Import py3nj | ||
run: | | ||
source /usr/share/miniconda/etc/profile.d/conda.sh; | ||
conda activate test_env; | ||
python -c "import py3nj" | ||
- name: Run tests | ||
run: | | ||
source /usr/share/miniconda/etc/profile.d/conda.sh; | ||
conda activate test_env; | ||
python -m pytest | ||
- name: Upload test results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Test results for ${{ runner.os }}-${{ matrix.python-version }} | ||
path: pytest.xml |
File renamed without changes.
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,5 +1,5 @@ | ||
name: test_env | ||
dependencies: | ||
- python=3.7 | ||
- python=3.10 | ||
- pytest | ||
- numpy |
File renamed without changes.
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,5 +1,5 @@ | ||
name: test_env | ||
dependencies: | ||
- python=2.7 | ||
- python=3.8 | ||
- pytest | ||
- numpy |
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,36 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools", | ||
"setuptools-scm", | ||
"numpy", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "py3nj" | ||
authors = [ | ||
{name = "Keisuke Fujii", email = "[email protected]"}, | ||
] | ||
description = "numpy compatible wigner 3n-J symbols" | ||
readme = "README.md" | ||
license = {file = "LICENSE"} | ||
keywords = ["atomic physics", "quantum physics"] | ||
dependencies = [ | ||
"numpy", | ||
] | ||
classifiers = [ | ||
"License :: OSI Approved :: BSD License", | ||
"Natural Language :: English", | ||
"Operating System :: MacOS :: MacOS X", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3.6", | ||
"Topic :: Scientific/Engineering :: Physics", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.urls] | ||
"Source Code" = "http:/fujiisoup/py3nj" | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "py3nj._version.__version__"} |
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,20 +1,7 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from __future__ import print_function | ||
import re | ||
from numpy.distutils.core import setup, Extension | ||
|
||
# load version form _version.py | ||
VERSIONFILE = "py3nj/_version.py" | ||
verstrline = open(VERSIONFILE, "rt").read() | ||
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" | ||
mo = re.search(VSRE, verstrline, re.M) | ||
if mo: | ||
verstr = mo.group(1) | ||
else: | ||
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,)) | ||
|
||
# fortran extension | ||
ext = Extension( | ||
name="py3nj._wigner", | ||
sources=[ | ||
|
@@ -28,27 +15,8 @@ | |
extra_compile_args=["-fopenmp"], | ||
) | ||
|
||
# module | ||
setup( | ||
name="py3nj", | ||
version=verstr, | ||
author="Keisuke Fujii", | ||
author_email="[email protected]", | ||
description=("numpy compatible wigner 3n-J symbols"), | ||
license="BSD 3-clause", | ||
keywords="atomic physics, quantum physics", | ||
url="http:/fujiisoup/py3nj", | ||
packages=["py3nj"], | ||
package_dir={"py3nj": "py3nj"}, | ||
py_modules=["py3nj.__init__"], | ||
package_dir = {'py3nj': 'src'}, | ||
ext_modules=[ext], | ||
classifiers=[ | ||
"License :: OSI Approved :: BSD License", | ||
"Natural Language :: English", | ||
"Operating System :: MacOS :: MacOS X", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3.6", | ||
"Topic :: Scientific/Engineering :: Physics", | ||
], | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.