Skip to content

Commit

Permalink
Version 20230905
Browse files Browse the repository at this point in the history
  • Loading branch information
mborsetti committed Sep 5, 2023
1 parent d38adfc commit 53f828e
Show file tree
Hide file tree
Showing 15 changed files with 311 additions and 205 deletions.
82 changes: 42 additions & 40 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,57 @@ on: [push, pull_request, workflow_dispatch]

env:
FORCE_COLOR: 1
PYTHONUNBUFFERED: 1
PYTHONUTF8: 1

jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
pre-commit:
# Name the Job
name: Quality assurance (pre-commit)
# Set the type of machine to run on
runs-on: ubuntu-latest

steps:
# Checks out a copy of the repository per https://github.com/actions/checkout
- name: Check out repo
uses: actions/checkout@main

# Build Python and packages per https://github.com/actions/setup-python
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: '3.11'
cache: 'pip'

# Install dependencies needed by the repo: local in .pre-commit-config.yaml
- name: Install dependencies
run: |
pip install -U pip wheel
if [ -f tests/requirements_precommit.txt ]; then pip install -U -r tests/requirements_precommit.txt; fi
if [ -f requirements.txt ]; then pip install -U -r requirements.txt; fi
# The below has been replaced with the integration in GitHub of the "pre-commit ci" app https://pre-commit.ci
# # Run pre-commit cache per https://github.com/pre-commit/action
# - name: Run pre-commit
# uses: pre-commit/action@v2.0.3
# env:
# PYTHONUTF8: 1
# PRE-COMMIT IS ALREADY DONE BY GIT
# pre-commit:
# # Name the Job
# name: Quality assurance (pre-commit)
# # Set the type of machine to run on
# runs-on: ubuntu-latest
#
# steps:
# # Checks out a copy of the repository per https://github.com/actions/checkout
# - name: Check out repo
# uses: actions/checkout@main
#
# # Build Python and packages per https://github.com/actions/setup-python
# - name: Set up Python
# uses: actions/setup-python@main
# with:
# python-version: '3.11' # same as https://docs.readthedocs.io/en/stable/config-file/v2.html#build-tools-python
# cache: 'pip'
# cache-dependency-path: |
# requirements.txt
# tests/requirements_pre-commit.txt
#
# # Install dependencies needed by the repo: local in .pre-commit-config.yaml
# - name: Install dependencies
# run: |
# pip install -U pip wheel
# if [ -f tests/requirements_pre-commit.txt ]; then pip install -U -r tests/requirements_pre-commit.txt; fi
# if [ -f requirements.txt ]; then pip install -U -r requirements.txt; fi
#
# # The below has been replaced with the integration in GitHub of the "pre-commit ci" app https://pre-commit.ci
# # # Run pre-commit cache per https://github.com/pre-commit/action
# # - name: Run pre-commit
# # uses: pre-commit/action@v2.0.3

test:
name: "Test (${{ matrix.python-version }}, ${{ matrix.os }})"
# matrix.os is defined in strategy
runs-on: ${{ matrix.os }}
# Identifies any jobs that must complete successfully before this job will run
needs: [pre-commit]
# needs: [pre-commit]
# A strategy creates a build matrix for your jobs. You can define different variations to run each job in
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.11', '3.10', '3.9', '3.8']
python-version: ['3.11', '3.10', '3.9', '3.8', '3.12.0-rc.1']
# for valid python-version see https://github.com/actions/python-versions/releases

env:
Expand Down Expand Up @@ -131,7 +134,7 @@ jobs:
name: Deploy release
runs-on: ubuntu-latest
# ref https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [test]
steps:
- name: Check out repo
Expand All @@ -140,22 +143,21 @@ jobs:
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: '3.10'
python-version: '3.11'
cache: 'pip'

# Install pip dependencies executing setup.py
# Install pip dependencies
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -U .
pip install -U pip build
- name: Build dist
run: |
python setup.py sdist bdist_wheel
python -m build
# PyPI publish GitHub Action from https://github.com/pypa/gh-action-pypi-publish
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
Expand Down
18 changes: 10 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# NOTE: in this package implementation, tox runs 'pre-commit run -a'
# To manually run without committing > pre-commit run --all-files

minimum_pre_commit_version: 3.1.1
minimum_pre_commit_version: 3.4.0

# Force all unspecified python hooks to run python3
default_language_version:
Expand Down Expand Up @@ -144,13 +144,14 @@ repos:
language: python
types: [python]
args: [--show-error-codes]
- id: tox-ini-fmt # https://github.com/tox-dev/tox-ini-fmt
name: Apply a consistent format to tox.ini files (tox-ini-fmt)
entry: tox-ini-fmt
additional_dependencies: [tox-ini-fmt]
language: python
files: tox.ini
types: [ini]
# Not using the below as it removes remarks
# - id: tox-ini-fmt # https://github.com/tox-dev/tox-ini-fmt
# name: Apply a consistent format to tox.ini files (tox-ini-fmt)
# entry: tox-ini-fmt
# additional_dependencies: [tox-ini-fmt]
# language: python
# files: tox.ini
# types: [ini]

# - repo: https://github.com/pycqa/doc8
# rev: 0.9.0a1
Expand Down Expand Up @@ -194,3 +195,4 @@ repos:
name: Update database counts in README.rst
entry: python update_readme_counts.py
language: system
pass_filenames: false
24 changes: 23 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,32 @@ on the UTC date of the release.

`Contributions <https://github.com/mborsetti/airportdata/blob/master/CHANGELOG.rst>`__ always welcomed!

Notice
======
Support for Python 3.8 will be removed on or about 5 October 2023. Older Python versions are supported for 3 years
after being obsoleted by a new major release (i.e. about 4 years since their original release). This will not affect
the CSV file.


20230905
================
* Fixed names of airports, cities, subdivisions (which now match `ISO 3166-2
<https://en.wikipedia.org/wiki/ISO_3166-2:UA#Current_codes>`__ names) and timezones for Ukraine (contributed by
`YURII D. <https://github.com/dejurin>`__ via pull request `#30
<https://github.com/mborsetti/airportsdata/issues/30>`__).
* Fixed script for various Norwegian airports, which lacked accents etc.
* Internal:

- Upgraded build environment to ``build`` using ``pyproject.toml``, eliminating ``setup.py``.
- Consolidated tool config files into ``pyproject.toml`` where possible.
- Simplified timezone testing.
- Added testing to reach (hopefully) 100% coverage.
- Upgraded ``tox`` testing framework.
- Support Python 3.12 (version 3.12.0-rc.1).

20230717
================
* Added new airport LRBV/GHV, Braşov-Ghimbav International Airport, Braşov, Transylvania, Romania (reported by `Jonas
* Added new airport LRBV/GHV, Braşov-Ghimbav International Airport, Braşov, Transylvania, Romania (contributed by `Jonas
Eberle <https://github.com/jonaseberle>`__ in issue `#28 <https://github.com/mborsetti/airportsdata/issues/28>`__).


Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://docs.python.org/3/distutils/sourcedist.html#specifying-the-files-to-distribute
# do not include test files
prune tests
45 changes: 29 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,37 +1,46 @@
============
airportsdata
============
========================
airportsdata |downloads|
========================

.. |ICAO| replace:: 28,131

.. |IATA| replace:: 7,586

.. |LID| replace:: 12,567

.. |version| image:: https://img.shields.io/pypi/v/airportsdata.svg
.. |pyversion| image:: https://img.shields.io/pypi/v/airportsdata.svg
:target: https://pypi.org/project/airportsdata/
:alt: pypi version

.. |support| image:: https://img.shields.io/pypi/pyversions/airportsdata.svg
:target: https://pypi.org/project/airportsdata/
:alt: supported Python version

.. |pypi_version| image:: https://img.shields.io/pypi/v/airportsdata.svg?label=
:target: https://pypi.org/project/airportsdata/
:alt: PyPI version
.. |format| image:: https://img.shields.io/pypi/format/airportsdata.svg
:target: https://pypi.org/project/airportsdata/
:alt: Kit format
.. |downloads| image:: https://static.pepy.tech/badge/airportsdata
:target: https://www.pepy.tech/project/airportsdata
:alt: PyPI downloads
.. |license| image:: https://img.shields.io/pypi/l/airportsdata.svg
:target: https://pypi.org/project/airportsdata/
:alt: license

.. |issues| image:: https://img.shields.io/github/issues-raw/mborsetti/airportsdata
:target: https://github.com/mborsetti/airportsdata/issues
:alt: issues

.. |CI| image:: https://github.com/mborsetti/airportsdata/workflows/Tests/badge.svg?branch=main
.. |CI| image:: https://github.com/mborsetti/airportsdata/actions/workflows/ci-cd.yaml/badge.svg?event=push
:target: https://github.com/mborsetti/airportsdata/actions
:alt: CI testing status

.. |coveralls| image:: https://coveralls.io/repos/github/mborsetti/airportsdata/badge.svg?branch=main
:target: https://coveralls.io/github/mborsetti/airportsdata?branch=main
:alt: code coverage by Coveralls

.. |status| image:: https://img.shields.io/pypi/status/airportsdata.svg
:target: https://pypi.org/project/airportsdata/
:alt: Package stability
.. |security| image:: https://img.shields.io/badge/security-bandit-yellow.svg
:target: https://github.com/PyCQA/bandit
:alt: Security Status

Extensive database of location and timezone data for nearly every operational airport and landing strip in the world,
with |ICAO| entries.
Expand All @@ -41,8 +50,9 @@ Each entry consists of the following data:
* ``icao``: ICAO 4-letter DOC7910 Location Indicator or (if none) an internal Pseudo-ICAO Identifier[*] (|ICAO| entries)
* ``iata``: IATA 3-letter Location Code (|IATA| entries) or an empty string[#]
* ``name``: Official name (latin script)
* ``city``: City
* ``subd``: Subdivision (e.g. state, province, region, etc.)
* ``city``: City in latin script, ideally using the local language
* ``subd``: Subdivision (e.g. state, province, region, etc.), ideally using the local-language or English names of
`ISO 3166-2 <https://en.wikipedia.org/wiki/ISO_3166-2#Current_codes>`__
* ``country``: `ISO 3166-1 <https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes>`__ alpha-2 country code
(plus ``XK`` for Kosovo)
* ``elevation``: MSL elevation (the highest point of the landing area) in feet; it is often wrong
Expand Down Expand Up @@ -72,19 +82,19 @@ Please report any issues you may find `here
<https://github.com/mborsetti/airportsdata/blob/main/CONTRIBUTING.rst>`__.

This project is a fork of https://github.com/mwgg/Airports. All new data submitted in this fork have been validated
against national `Aeronauical Information Publications (AIP) or equivalent
against national `Aeronautical Information Publications (AIP) or equivalent
<https://github.com/mborsetti/airportsdata/blob/main/README_AIP.rst>`__ (or
ARINC database) and `IATA <https://www.iata.org/en/publications/directories/code-search/>`__ before publishing.

Raw data
========

A CSV (comma separated values) file with headers (UTF-8 encoding) is downloadable from GitHub `here
A CSV (comma separated values) file, with headers and encoded in UTF-8, is downloadable from GitHub `here
<https://github.com/mborsetti/airportsdata/raw/main/airportsdata/airports.csv>`__.

Python
======
|version| |support| |CI| |coveralls| |issues|
|pyversion| |support| |format| |status| |security| |CI| |coveralls| |issues|

Install from `PyPi <https://pypi.org/project/airportsdata/>`__ using pip:

Expand Down Expand Up @@ -116,6 +126,9 @@ or
airports = airportsdata.load('LID') # key is the FAA LID
print(airports['01AA'])
Older Python versions are supported for 3 years after being obsoleted by a new major release (i.e. about 4 years
since their original release).

License
=======

Expand Down
21 changes: 19 additions & 2 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
* Added new airport LRBV/GHV, Braşov-Ghimbav International Airport, Braşov, Transylvania, Romania (reported by `Jonas
Eberle <https://github.com/jonaseberle>`__ in issue `#28 <https://github.com/mborsetti/airportsdata/issues/28>`__).
* Fixed names of airports, cities, subdivisions (which now match `ISO 3166-2
<https://en.wikipedia.org/wiki/ISO_3166-2:UA#Current_codes>`__ names) and timezones for Ukraine (contributed by
`YURII D. <https://github.com/dejurin>`__ via pull request `#30
<https://github.com/mborsetti/airportsdata/issues/30>`__).
* Fixed script for various Norwegian airports, which lacked accents etc.
* Internal:

- Upgraded build environment to ``build`` using ``pyproject.toml``, eliminating ``setup.py``.
- Consolidated tool config files into ``pyproject.toml`` where possible.
- Simplified timezone testing.
- Added testing to reach (hopefully) 100% coverage.
- Upgraded ``tox`` testing framework.
- Support Python 3.12 (version 3.12.0-rc.1).

**Notice**

Support for Python 3.8 will be removed on or about 5 October 2023. Older Python versions are supported for 3 years
after being obsoleted by a new major release (i.e. about 4 years since their original release). This will not affect
the CSV file.
2 changes: 1 addition & 1 deletion airportsdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

__project_name__ = __package__
# Release numbering follows the release date
__version__ = '20230717'
__version__ = '20230905'
__min_python_version__ = (3, 8)
__author__ = 'Mike Borsetti <mike@borsetti.com>'
__copyright__ = 'Copyright 2020- Mike Borsetti'
Expand Down
Loading

0 comments on commit 53f828e

Please sign in to comment.