Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blaylockbk/issue14 #15

Merged
merged 2 commits into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ build/*
MANIFEST
.eggs/
core.*

_version.py
35 changes: 35 additions & 0 deletions HOW-TO-RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# How to publish a new release

> NOTE: These are Brian's personal notes.

Update version in
- `CITATION.cff`

Create a tag and release in GitHub

Created a new conda environment with twine
```
conda create -n pypi python=3 twine pip -c conda-forge
```
```
conda activate pypi
cd SynopticPy
python setup.py sdist bdist_wheel

twine check dist/*
```

Upload to Test PyPI
```
twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*
```

Upload to PyPI
```
twine upload --skip-existing dist/*
```


## Conda release

TODO
11 changes: 11 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prune .github
prune .vscode
prune ci
prune docs
prune images
prune notebooks
prune references
prune sample_data
exclude *.ipynb
exclude *.nc
exclude *.grib2
12 changes: 7 additions & 5 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: synoptic
channels:
- conda-forge
dependencies:
- python=3.10
- python=3.11
- pip
- git

Expand All @@ -26,7 +26,6 @@ dependencies:
# Formatter and Testing
# ---------------------
- black
- jupyterlab_code_formatter
- isort
- pylint
- pytest
Expand All @@ -45,12 +44,15 @@ dependencies:
- myst-parser
- linkify-it-py

- pip:
#- pip:
# Development Version from GitHub
- git+https://github.com/blaylockbk/SynopticPy.git
#- git+https://github.com/blaylockbk/SynopticPy.git

# Or, latest release from PyPI
#- SynopticPy

# Borrow some tools from Brian's garage
- git+https://github.com/blaylockbk/Carpenter_Workshop.git
#- git+https://github.com/blaylockbk/Carpenter_Workshop.git


## Or, clone the repo and do `pip install -e .`
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
version_scheme = "post-release"
local_scheme = "no-local-version"
write_to = "synoptic/_version.py"

[tool.isort]
profile = "black"
59 changes: 59 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[metadata]
name = SynopticPy
description = Load mesonet weather and environmental data from the Synoptic API into a Pandas Dataframe.
author = Brian K. Blaylock
author_email = [email protected]
long_description = file: README.md
long_description_content_type = text/markdown
license = MIT
license_file = LICENSE
platform = any
url = https://github.com/blaylockbk/SynopticPy
project_urls =
Source Code = https://github.com/blaylockbk/SynopticPy
Documentation = https://blaylockbk.github.io/SynopticPy/_build/html/
Release Notes = https://github.com/blaylockbk/SynopticPy/releases
Bug Tracker = https://github.com/blaylockbk/SynopticPy/issues
keywords =
meteorology
weather
mesonet
classifiers =
Development Status :: 4 - Beta
Programming Language :: Python :: 3
Operating System :: OS Independent
License :: OSI Approved :: MIT License
Intended Audience :: Science/Research
Topic :: Scientific/Engineering :: Atmospheric Science

[options]
packages = find:
include_package_data = True
setup_requires = setuptools_scm
python_requires = >=3.8
zip_safe = False
install_requires =
numpy
pandas
requests
toml

## Something wrong with the below??

#[options.extra_require]
#tests =
# pytest
# black
# isort
#doc =
# sphinx
# nbsphinx
# pydata-sphinx-theme
# sphinx-design
# autodocsumm
# myst-parser
#
#[build_sphinx]
#source-dir = docs
#build-dir = docs/_build
#
75 changes: 3 additions & 72 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,73 +1,4 @@
from pathlib import Path
from setuptools import setup, find_packages
from setuptools import setup

HERE = Path(__file__).parent
README = (HERE / "README.md").read_text(encoding="utf8")

setup(
name="SynopticPy", # I have to use 'SynopticPy' because 'synoptic' is used
version="0.0.7",
author="Brian K. Blaylock",
author_email="[email protected]",
description="Load mesonet weather and environmental data from the Synoptic API into a Pandas Dataframe",
long_description=README,
long_description_content_type="text/markdown",
project_urls={
"Source Code": "https://github.com/blaylockbk/SynopticPy",
"Documentation": "https://github.com/blaylockbk/SynopticPy/blob/main/README.md",
"Official Synoptic Docs": "https://developers.synopticdata.com/mesonet/",
},
license="MIT",
packages=find_packages(),
package_data={
"": ["*.cfg"],
},
install_requires=["numpy", "pandas", "requests", "toml"],
keywords=["pandas", "meteorology", "weather", "mesonet", "Synoptic", "MesoWest"],
classifiers=[
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Atmospheric Science",
],
zip_safe=False,
)

###############################################################################
## Brian's Note: How to upload a new version to PyPI
## -------------------------------------------------
# Update version in
# - setup.py
# - CITATION.cff
# - Create a tag and release in GitHub
# Created a new conda environment with twine
# conda create -n pypi python=3 twine pip -c conda-forge
"""
conda activate pypi
cd SynopticPy
python setup.py sdist bdist_wheel

twine check dist/*

# Test PyPI
twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*

# PyPI
twine upload --skip-existing dist/*
"""


#######################################################
## On May 12, 2022 I changed the default branch to main
## You can change your local clone default name with
## The following
"""
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
"""
if __name__ == "__main__":
setup()
5 changes: 5 additions & 0 deletions synoptic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
__url__ = "https://github.com/blaylockbk/SynopticPy"


try:
from ._version import __version__
except:
pass

# Note to self: Synoptic's config file is created by the get_token.py script

try:
Expand Down