Skip to content

Commit

Permalink
packaging and feedstock changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jukent committed Apr 27, 2023
1 parent 17216ca commit dd8f9b6
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 73 deletions.
54 changes: 49 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,45 @@ on:
workflow_dispatch:

jobs:
docs:
test:
name: Python (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}

strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "macos-latest"]
python-version: [ "3.8", "3.9", "3.10" ]
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- name: checkout
uses: actions/checkout@v3
with:
token: ${{ github.token }}
- name: conda_setup
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: geocat_viz_build
channel-priority: strict
python-version: ${{ matrix.python-version }}
channels: conda-forge
environment-file: build_envs/environment.yml

- name: Install geocat-comp
run: |
python -m pip install . --no-deps
- name: conda list
run: |
conda list
link-check:
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -22,12 +60,18 @@ jobs:
- name: conda_setup
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: gv-docs
activate-environment: gc-docs
channel-priority: strict
python-version: "3.10"
python-version: 3.9
channels: conda-forge
environment-file: build_envs/docs.yml
- name: Make docs
- name: Install geocat-viz
run: |
python -m pip install .
- name: check conda list
run: |
conda list
- name: Make docs with linkcheck
run: |
cd docs
make html
make linkcheck
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ docs/_build/

# python builds
*__pycache__/
dist/
.eggs/
*egg-info
3 changes: 0 additions & 3 deletions build_envs/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ dependencies:
- cmaps
- matplotlib<=3.5
- pint
- pip
- pre-commit
- sphinx-book-theme
- myst-nb
- nbsphinx
- sphinx-design
- xarray<=2023.02.0 #pin per issue https://github.com/NCAR/geocat-comp/issues/381
- pip:
- -e ..
6 changes: 4 additions & 2 deletions meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ source:
# git_url: https://github.com/NCAR/{{ name }}.git
build:
noarch: python
number: 0
script: {{ PYTHON }} -m pip install --no-deps --ignore-installed -vv .
number: 1
script: SETUPTOOLS_SCM_PRETEND_VERSION={{ version }} {{ PYTHON }} -m pip install --no-deps --ignore-installed -vv .

requirements:
build:
Expand Down Expand Up @@ -48,6 +48,8 @@ test:
# - geocat.viz.plot_classes
# - geocat.viz.util
commands:
# print package version
- python -c "import geocat.comp; print(geocat.comp.__version__)"
- pip check
source_files:
- src
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=42",
"setuptools-scm>=7",
]

[tool.setuptools_scm]
fallback_version = "999"
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

57 changes: 2 additions & 55 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,57 +1,4 @@
#!/usr/bin/env python
from setuptools import setup

with open('README.md') as f:
long_description = f.read()

with open('requirements.txt') as f:
requirements = f.read().strip().split('\n')


# ''' moved into function, can now be used other places
def version():
for line in open('meta.yaml').readlines():
index = line.find('set version')
if index > -1:
return line[index + 15:].replace('\" %}', '').strip()


setup(
name='geocat.viz',
version=version(),
long_description=long_description,
long_description_content_type='text/markdown',
maintainer='GeoCAT',
maintainer_email='geocat@ucar.edu',
python_requires='>=3.7',
install_requires=requirements,
url='https://github.com/NCAR/geocat-viz',
classifiers=[
'Intended Audience :: Science/Research',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Scientific/Engineering',
],
namespace_packages=['geocat'],
packages=[
'geocat',
'geocat.viz', # 'geocat.viz.plot_classes', 'geocat.viz.util',
],
package_dir={
'': 'src',
'geocat': 'src/geocat',
'geocat.viz': 'src/geocat/viz',
# 'geocat.viz.plot_classes': 'src/geocat/viz/plot_classes',
# 'geocat.viz.util': 'src/geocat/viz/util',
},
include_package_data=True,
project_urls={
'Documentation': 'https://geocat-viz.readthedocs.io',
'Source': 'https://github.com/NCAR/geocat-viz',
'Tracker': 'https://github.com/NCAR/geocat-viz/issues',
},
zip_safe=False,
)
setup(use_scm_version={"fallback_version": "999"})

0 comments on commit dd8f9b6

Please sign in to comment.