Skip to content

Commit 6e7c6c0

Browse files
committed
fix: standardize email formatting and improve import statement in __init__.py
1 parent 48f9476 commit 6e7c6c0

4 files changed

Lines changed: 24 additions & 40 deletions

File tree

.github/workflows/python-package-conda.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
source $CONDA/etc/profile.d/conda.sh
2929
conda activate test_pydsm
3030
conda config --set anaconda_upload yes
31+
export SETUPTOOLS_SCM_PRETEND_VERSION=$(python -m setuptools_scm)
3132
conda build -c conda-forge -c cadwr-dms -c defaults --user cadwr-dms --token "$ANACONDA_CHANNEL_UPLOAD_TOKEN" conda.recipe
3233
conda activate
3334
conda remove -n test_pydsm --all

conda.recipe/meta.yaml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{% set name = "pydsm" %}
2-
{% set data = load_setup_py_data() %}
2+
{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %}
3+
{% set project = pyproject['project'] %}
34

45
package:
56
name: "{{ name|lower }}"
6-
version: "{{ data['version'] }}"
7+
version: {{ SETUPTOOLS_SCM_PRETEND_VERSION }}
78

89
source:
910
#git_url: https://github.com/CADWRDeltaModeling/pydsm.git
@@ -12,28 +13,29 @@ source:
1213
build:
1314
number: 0
1415
noarch: python
15-
script: python setup.py install --single-version-externally-managed --record=record.txt
16+
script_env:
17+
- SETUPTOOLS_SCM_PRETEND_VERSION
18+
script: {{ PYTHON }} -m pip install --no-build-isolation --no-deps --ignore-installed -vv .
19+
noarch: python
20+
number: 0
1621
entry_points:
17-
- pydsm = pydsm.cli:main
22+
{% for name, reference in project['scripts'].items() %}
23+
- {{ name }} = {{ reference }}
24+
{% endfor %}
1825
#skip: true
1926

2027
requirements:
21-
build:
22-
- python {{ python }}
23-
- setuptools
24-
{% for dep in data['setup_requires'] %}
25-
- {{ dep.lower() }}
26-
{% endfor %}
27-
# dependencies are defined in setup.py
28-
{% for dep in data['install_requires'] %}
28+
host:
29+
- python {{ project['requires-python'] }}
30+
- pip
31+
{% for dep in pyproject['build-system']['requires'] %}
2932
- {{ dep.lower() }}
3033
{% endfor %}
3134
run:
3235
- {{ pin_compatible('python', lower_bound='3.5', upper_bound='4.0') }}
33-
# dependencies are defined in setup.py
34-
{% for dep in data['install_requires'] %}
36+
{% for dep in project.get('dependencies', []) %}
3537
- {{ dep.lower() }}
36-
{% endfor %}
38+
{% endfor %}
3739
test:
3840
imports:
3941
- pydsm
@@ -42,6 +44,9 @@ requirements:
4244
requires:
4345
- pytest
4446
- pytest-cov
47+
{% for dep in project.get("optional-dependencies", {}).get('test', []) %}
48+
- {{ dep.lower() }}
49+
{% endfor %}
4550
commands:
4651
- (setlocal && cd tests && pytest && endlocal) # [win]
4752
- (cd tests; pytest) # [unix]

pydsm/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"""Top-level package for pydsm."""
44

55
__author__ = """Nicky Sandhu"""
6-
__email__ = 'psandhu@water.ca.gov'
7-
__all__=[]
6+
__email__ = "psandhu@water.ca.gov"
7+
__all__ = []
88

9-
from . import _version
10-
__version__ = _version.__version__
9+
from ._version import __version__

pydsm/_version.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)