Skip to content

Commit

Permalink
v1.5.2; package dependancy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
amckenna41 committed Mar 8, 2024
1 parent 6b94328 commit e24e897
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 161 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
continue-on-error: true

#unit tests using pytest, unittest, flake8 and bandit frameworks
- name: Testing with unittest
- name: Running unit tests
env:
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
run: |
Expand All @@ -82,6 +82,7 @@ jobs:
#create coverage report using pytest package
- name: Generate Coverage Report
if: ${{ matrix.python-version == '3.9' }}
env:
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
run: |
Expand Down
25 changes: 11 additions & 14 deletions .github/workflows/deploy_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,21 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

# install all required modules and dependancies using pip and setup.py installation
# install all required modules and dependancies using pip and pyproject.toml installation
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python3 setup.py install
pip install build
python -m pip install --upgrade pip twine build
# Build package
- name: Build package
# build distribution package of software and upload to the PYPi server
- name: Build and Upload to PyPI
run: |
python -m build
# publish to pypi
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
python3 -m build
twine check dist/*
python3 -m twine upload dist/* --verbose
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_REPOSITORY: pypi

#sleep for 30 seconds to ensure that distribution package has finised uploading to Test PyPI
- name: Wait / Sleep
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy_test_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

# install all required modules and dependancies using pip and setup.py installation
# install all required modules and dependancies using pip and pyproject.toml installation
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python3 -m pip install setuptools wheel twine
python3 -m pip install setuptools wheel twine build
python3 setup.py install
# build distribution package of software and upload to the test PYPi server
- name: Build and Upload to TestPyPI
run: |
python3 setup.py sdist bdist_wheel
python3 -m build
twine check dist/*
twine upload --repository testpypi dist/* --verbose
python3 -m twine upload --repository testpypi dist/* --verbose
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TEST }}
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
graft iso3166_2/iso3166-2-data*
graft iso3166_2/iso3166_2_data*
include README.md
recursive-exclude __pycache__ *
exclude API.md
Expand Down
4 changes: 3 additions & 1 deletion ToDo.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ https://iso3166-updates.com/api/year/2020 : up-to-date.
- [X] Update /docs
- [X] In api docs, put API funcs all into one section.
- [X] Check order of sections in readme.
- [ ] In workflows, change "Testing with unittest" to "Running unit tests"
- [X] In workflows, change "Testing with unittest" to "Running unit tests"
- [X] Change setup.py to pyprojet.tml - https://packaging.python.org/en/latest/tutorials/packaging-projects/ - swap for setup.cfg
- [X] /iso3166_2_data not being included in package - incorrect filename in MANIFEST file.

Future Additions
----------------
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
project = 'iso3166-2'
copyright = '2024, AJ McKenna'
author = 'AJ McKenna'
release = '1.5.0'
release = '1.5.2'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sphinx==3.4.3
sphinx
sphinx_autodoc_typehints==1.12.0
sphinx_autodoc_defaultargs==0.1.2
sphinx-rtd-theme
Expand Down
38 changes: 38 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

[project]
name = "iso3166-2"
version = "1.5.2"
description = "A lightweight Python package, and accompanying API, that can be used to access all of the world's most up-to-date and accurate ISO 3166-2 subdivision data, including: name, local name, code, parent code, type, latitude/longitude and flag."
authors = [
{ name="AJ McKenna", email="amckenna41@qub.ac.uk" },
]
maintainers = "AJ McKenna <amckenna41@qub.ac.uk>"
license = "MIT"
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
"License :: Free For Educational Use",
"Natural Language :: English",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10"',
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Software Development :: Libraries :: Python Modules"
]
keywords = ["iso", "iso3166", "beautifulsoup", "python", "pypi", "countries", "country codes", "iso3166-2", "iso3166-1", "alpha-2", "iso3166-updates", "subdivisions", "regions"]
dependancies = ["iso3166", "natsort", "thefuzz", "unidecode"]

[project.urls]
homepage = "https://iso3166-2-api.vercel.app/api"
repository = "https://github.com/amckenna41/iso3166-2"
documentation = "https://iso3166-2.readthedocs.io/en/latest/"
71 changes: 0 additions & 71 deletions setup.cfg

This file was deleted.

67 changes: 0 additions & 67 deletions setup.py

This file was deleted.

0 comments on commit e24e897

Please sign in to comment.