Skip to content

Commit

Permalink
v1.5.2; dependancy and package manager fix
Browse files Browse the repository at this point in the history
  • Loading branch information
amckenna41 committed Mar 8, 2024
1 parent e24e897 commit 0ef0dcd
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 59 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
pip install safety
pip install importlib-metadata
pip install iso3166-2
pip install poetry
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python3 setup.py install
Expand Down
28 changes: 7 additions & 21 deletions .github/workflows/deploy_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,17 @@ jobs:
runs-on: ubuntu-latest # platform: [ubuntu-latest, macos-latest, windows-latest]
strategy:
matrix:
python-version: [3.8] #deploying using one Python version on 1 runner
python-version: [3.9] #deploying using one Python version on 1 runner
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

# install all required modules and dependancies using pip and pyproject.toml installation
- name: Install dependencies
run: |
python -m pip install --upgrade pip twine build

# build distribution package of software and upload to the PYPi server
- name: Build and Upload to PyPI
run: |
python3 -m build
twine check dist/*
python3 -m twine upload dist/* --verbose
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_REPOSITORY: pypi
# build distribution package using poetry tool and upload to the PYPi server via custom github action
- name: Build and publish to PyPI
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}

#sleep for 30 seconds to ensure that distribution package has finised uploading to Test PyPI
#sleep for 30 seconds to ensure that distribution package has finished uploading to PyPI
- name: Wait / Sleep
uses: jakejarvis/wait-action@master
with:
Expand Down
35 changes: 10 additions & 25 deletions .github/workflows/deploy_test_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,23 @@ on:
#build and deploy to Test PyPI server
jobs:
build:

name: Deploy to TestPyPI 📦
runs-on: ubuntu-latest # platform: [ubuntu-latest, macos-latest, windows-latest]
strategy:
matrix:
python-version: [3.8] #deploying using one Python version on 1 runner
python-version: [3.9] #deploying using one Python version on 1 runner
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

# 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 build
python3 setup.py install
- uses: actions/checkout@v3

# build distribution package of software and upload to the test PYPi server
- name: Build and Upload to TestPyPI
run: |
python3 -m build
twine check dist/*
python3 -m twine upload --repository testpypi dist/* --verbose
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TEST }}
TWINE_REPOSITORY: testpypi
# build distribution package using poetry tool and upload to the test PYPi server via custom github action
- name: Build and publish to Test PyPI
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TEST }}
repository_name: "testpypi"
repository_url: "https://test.pypi.org/legacy/"

#sleep for 30 seconds to ensure that distribution package has finised uploading to Test PyPI
#sleep for 30 seconds to ensure that distribution package has finished uploading to Test PyPI
- name: Wait / Sleep
uses: jakejarvis/wait-action@master
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ test-iso3166_2/
iso3166-2-data-archive/
get_iso3166_2.py
.DS_Store
poetry.lock

.vscode

Expand Down
32 changes: 21 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@

[project]
[tool.poetry]
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="[email protected]" },
]
maintainers = "AJ McKenna <[email protected]>"
authors = ["AJ Mckenna <[email protected]>"]
maintainers = ["AJ McKenna <[email protected]>"]
license = "MIT"
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
Expand All @@ -21,7 +17,7 @@ classifiers = [
"Natural Language :: English",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10"',
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3 :: Only",
Expand All @@ -30,9 +26,23 @@ classifiers = [
"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"]
packages = [{include = "iso3166_2"}]

[tool.poetry.dependencies]
python = "^3.8"
iso3166 = "^2.1.1"
natsort = "^8.4.0"
thefuzz = "^0.22.1"
Unidecode = "^1.3.8"

[project.urls]
[tool.poetry.group.dev.dependencies]
pytest = "^8.0.2"

[tool.poetry.urls]
homepage = "https://iso3166-2-api.vercel.app/api"
repository = "https://github.com/amckenna41/iso3166-2"
documentation = "https://iso3166-2.readthedocs.io/en/latest/"
documentation = "https://iso3166-2.readthedocs.io/en/latest/"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
4 changes: 2 additions & 2 deletions tests/test_iso3166_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def setUp(self):

def test_iso3166_2_metadata(self):
""" Testing correct iso3166-2 software version and metadata. """
# self.assertEqual(metadata('iso3166-2')['version'], "1.5.1",
# "iso3166-2 version is not correct, expected 1.5.1, got {}.".format(metadata('iso3166-2')['version']))
# self.assertEqual(metadata('iso3166-2')['version'], "1.5.2",
# "iso3166-2 version is not correct, expected 1.5.2, got {}.".format(metadata('iso3166-2')['version']))
self.assertEqual(metadata('iso3166-2')['name'], "iso3166-2",
"iso3166-2 software name is not correct, expected iso3166-2, got {}.".format(metadata('iso3166-2')['name']))
self.assertEqual(metadata('iso3166-2')['author'], "AJ McKenna, https://github.com/amckenna41",
Expand Down

0 comments on commit 0ef0dcd

Please sign in to comment.