Skip to content

Commit

Permalink
Updates for wheel building and PyPi uploading(#14)
Browse files Browse the repository at this point in the history
* Pin dependency versions in setup.py
* Update README with setup and wheel building
* Fix email in setup
* Add dependencies for uploading to PyPi
* Config options for docs
  • Loading branch information
lawrencefoley authored Sep 19, 2021
1 parent c3c40fc commit 40599b3
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ fabric.properties
/venv/
/docs/_build/
evergy/__pycache__/*
dist/*
build/*
evergy.egg-info/dependency_links.txt
evergy.egg-info/PKG-INFO
evergy.egg-info/requires.txt
evergy.egg-info/SOURCES.txt
evergy.egg-info/top_level.txt
20 changes: 20 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF
#formats:
# - pdf

# Optionally set the version of Python and requirements required to build your docs
python:
version: "3.9"
install:
- requirements: docs/requirements_dev.txt
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include pyproject.toml

# Include the README
include *.md
33 changes: 29 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,48 @@ evergy.logout()
```

## Development
### Setup
```powershell
python -m pip install --upgrade virtualenv
virtualenv venv
.\venv\Scripts\activate.ps1
```

### Code Formatting
Install the dev dependencies and run `isort` and `flake8` to properly format the code.
```bash

pip install -r requirements_dev.txt
isort evergy/
flake8 evergy/
```

### Build Docs
Windows PowerShell:
```powershell
.\make.bat clean; .\make.bat html
```

### Release New Version
```bash
git commit -m "Bump version"
git tag -a v1.0.1 -m "v1.0.1"
git push --tags
```

### Build Docs
Windows PowerShell:
```powershell
.\make.bat clean; .\make.bat html
### Build Wheel
> The `--no-isolation` flag tells it to use the existing virtual env
```bash
python -m build --no-isolation --wheel
```

### Upload to PyPi
#### Test
```bash
twine upload --verbose -u "username" -p "password" --repository testpypi dist/*
```

#### Prod
```bash
twine upload --verbose -u "username" -p "password" --repository pypi dist/*
```
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = 'furo'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
3 changes: 3 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
isort==5.9.3
flake8==3.9.2
sphinx==4.2.0
furo==2021.9.8
myst-parser==0.15.2
build==0.7.0
twine==3.4.2
17 changes: 13 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,24 @@
here = path.abspath(path.dirname(__file__))

# Get the long description from the README file
with open(path.join(here, "README.md"), encoding="utf-8") as f:
with open(path.join(here, "README.md"), encoding="UTF-8") as f:
long_description = f.read()

setup(
name="evergy",
version=evergy.__version__,
description="A utility that reads electric utility meter data from Evergy.com",
long_description=long_description,
long_description_content_type='text/markdown',
url="https://github.com/lawrencefoley/evergy",
project_urls={
'Documentation': 'https://evergy.readthedocs.io/en/latest/',
'Source': 'https://github.com/lawrencefoley/evergy/',
'Tracker': 'https://github.com/lawrencefoley/evergy/issues',
'Maintainer': 'https://lawrencefoley.com',
},
author="Lawrence Foley",
author_email="emwav333@gmail.com",
author_email="lawrencefoley@live.com",
# Classifiers help users find your project by categorizing it.
#
# For a list of valid classifiers, see
Expand All @@ -28,7 +35,7 @@
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
# Indicate who your project is intended for
"Intended Audience :: Developers",
"Topic :: Utilities",
Expand Down Expand Up @@ -59,13 +66,15 @@
#
# For an analysis of "install_requires" vs pip's requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=["beautifulsoup4", "requests"], # Optional
install_requires=["beautifulsoup4==4.7.1", "requests==2.21.0"], # Optional
python_requires='>=3',
# If there are data files included in your packages that need to be
# installed, specify them here.
#
# If using Python 2.6 or earlier, then these have to be included in
# MANIFEST.in as well.
package_data={ # Optional
"credentials": ["credentials.json"],
"README": ["README.md"],
},
)

0 comments on commit 40599b3

Please sign in to comment.