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

python2.7 will be removed from the python-versions on June 19 #672

Closed
dmitry-shibanov opened this issue May 23, 2023 · 40 comments
Closed

python2.7 will be removed from the python-versions on June 19 #672

dmitry-shibanov opened this issue May 23, 2023 · 40 comments

Comments

@dmitry-shibanov
Copy link
Contributor

Breaking changes

Hello everyone. The Python 2.7.x will be removed from python-versions and it won't be possible to set up Python 2.7.x by setup-python.

The motivation for the changes

Python2.7 is not supported since January 1, 2020.

@rtibbles
Copy link

Hi @dmitry-shibanov - do you have any recommended ways to mitigate this for those of us that cannot remove usage of Python 2.7 from our Github Actions before the June 19th deadline?

@bernhardkaindl
Copy link

bernhardkaindl commented May 30, 2023

@dmitry-shibanov

It has already been delayed.

@konradpabjan I hope this can be cancelled like the previous times. I think there will be customer backslash again which would not be justified.

There is no point in removing it.

Linux Distros like Ubuntu 20.04 which contain Python2.7 support Python 2.7 for many many years to come. Canonical will maintain it until April 2025, and it will have emergency security updates in 20.04 until April 2030. Similar for Red Hat and SUSE.

@boegel
Copy link

boegel commented Jun 1, 2023

We started hitting this today already (1 June 2023), leading to:

Error: Version 2.7 with arch x64 not found

Support for Python 2.7 is deprecated in our project already, so we'll just stop testing on top of Python 2.7 and not lose sleep over it, but it would be nice if there's a documented/recommended alternative for people that do still want to keep testing on top of Python 2.7 in the near future.

@hugovk
Copy link
Contributor

hugovk commented Jun 1, 2023

There's a community-maintained Dockerfile in the works: actions/runner-images#7401 (comment)

mathiascode added a commit to tinytag/tinytag that referenced this issue Jun 2, 2023
Python 2.7 will not be supported by GitHub Actions any longer: actions/setup-python#672

We can continue using PyPy 2.7 to test Python 2 until we drop support in tinytag 2.0.0.
@tzortzispanagiotis
Copy link

Guys, do we have a suggested workaround? This is a huge deal for us - whole project depends on python 2 so we would not be able to deploy anything. If anyone has an idea, please help :)

@tzortzispanagiotis
Copy link

To anyone concerned:
You can continue using github-hosted runners with python2.7 by running the job inside a container.
e.g. I used python:2.7-buster image and everything works out just fine.

No need to use setup-python or be dependent of runner-images anymore.

@MatteoH2O1999
Copy link

MatteoH2O1999 commented Jun 8, 2023

If you don't need 2.7 for windows, you could use my custom action MatteoH2O1999/setup-python.
This action tries to build from source all Python versions that actions/setup-python does not support.
It also allows to cache built versions so that after the first run, installation time is really low.
For an example of a run see this workflow.

Windows support is in the works but no ETA (note that for Windows it will still allow for versions that are supported by 'actions/setup-python' to successfully complete).

@dimitrisr
Copy link

To anyone concerned: You can continue using github-hosted runners with python2.7 by running the job inside a container. e.g. I used python:2.7-buster image and everything works out just fine.

Hello @tzortzispanagiotis, could you please provide an example for this? 🙏

Thanks in advance.

@tzortzispanagiotis
Copy link

Hello @dimitrisr,

In order to overcome this I modified:

runs-on: ubuntu-20.04

to

runs-on: ubuntu-20.04
    container:
      image: python:2.7.18-buster

So that the job is run using a github-hosted runner, but inside the python2.7-buster container, which has set up python2.7

Then I started running the pipeline and started fixing everything that was broken (because the container does not have things as sudo, so you have to install it with a command)

Also, If your CI pipeline has other services (e.g. mysql) that run inside a container, now that the whole job is running inside a container, the service container is accessible not through localhost (127.0.0.1), but through the service name.

I hope I was helpful!

@dimitrisr
Copy link

Thank you @tzortzispanagiotis, this was really helpful! I was able to run the actions successfully :)

yuangezhizao added a commit to yuangezhizao/yabgp that referenced this issue Mar 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
zlpqingmei pushed a commit to smartbgp/yabgp that referenced this issue Mar 6, 2024
…in BGP UPDATE Message (#167)

* 🎨 Style(__init__.py): replace "Sid" with "SID"

* ✨ Feat(bgpprefixsid.py): add support for parsing the Path Attribute: BGP Prefix-SID (Type 40)

Refer:
https://github.com/Exa-Networks/exabgp/blob/main/src/exabgp/bgp/message/update/attribute/sr/prefixsid.py

* ✅ Test(test_bgpprefixsid.py): add unittest and format result

* 💚 Fix-ci(ci.yml): remove Python 2.7.x from the CI matrix
Refer: actions/setup-python#672

* 🔥 Prune(.travis.yml): remove Travis CI
ekalinin pushed a commit to ekalinin/nodeenv that referenced this issue May 28, 2024
* workflows: add a workflow_dispatch trigger to start workflows manually

To be able to manually run a workflow from the Github web interface, add
a workflow_dispatch trigger.

Note that this does only work once this change has hit the default
branch.

* workflow: remove python 2.7 testing

Python 2.7 is long obsolete, deprecated and not supported any more.
Remove it from the tests. This test job is especially supposed to run on
ubuntu-20.04, which doesn't have Python 2.7 any more.

Without this patch, this workflow fails with:

  Warning: The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672
  Version 2.7 was not found in the local cache
  Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 20.04.
  The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

* setup.py: ignore flake8 warning about module import at top of file

Flake8 is unhappy with us because we violate PEP8:

rsc@leda:~/git/nodeenv$ flake8 --extend-ignore=E127 nodeenv.py tests setup.py
setup.py:16:1: E402 module level import not at top of file

Ignore this warning in this case.

* nodeenv.py: do not compare types

According to this flake8 error:

(env) rsc@leda:~/git/nodeenv$ flake8 --extend-ignore=E127 nodeenv.py tests setup.py
nodeenv.py:421:19: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`

we should not compare types but use isinstance() instead, which can
handle subclasses as well.

See https://www.flake8rules.com/rules/E721.html for details.
benmwebb added a commit to salilab/mist that referenced this issue Jun 18, 2024
GitHub Actions no longer supports Python 2.7
as per actions/setup-python#672.
bfontaine added a commit to swaroopch/edn_format that referenced this issue Jun 24, 2024
tgragnato added a commit to immobiliare/collectd-haproxy-plugin that referenced this issue Jun 26, 2024
quark-zju added a commit to quark-zju/rust-cpython that referenced this issue Jul 1, 2024
Drop Python 2.7, as it is no longer available:

    Warning: The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672
    Version 2.7 was not found in the local cache
    Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 22.04.
    The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Add Python 3.12 as its support was just added.
quark-zju added a commit to quark-zju/rust-cpython that referenced this issue Jul 1, 2024
Drop Python 2.7, as it is no longer available:

    Warning: The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672
    Version 2.7 was not found in the local cache
    Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 22.04.
    The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Add Python 3.12 as its support was just added.

Fork macOS steps from Linux due to the ARM arch change:

- Rust 1.41 does not have a `aarch64-apple-darwin` version. The first Rust
  version that supports `aarch64-apple-darwin` is 1.49.0.
- Python 3.7 to 3.10 do not have a macOS ARM version.
quark-zju added a commit to quark-zju/rust-cpython that referenced this issue Jul 1, 2024
Drop Python 2.7, as it is no longer available:

    Warning: The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672
    Version 2.7 was not found in the local cache
    Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 22.04.
    The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Add Python 3.12 as its support was just added.

Fork macOS steps from Linux due to the ARM arch change:

- Rust 1.41 does not have a `aarch64-apple-darwin` version. The first Rust
  version that supports `aarch64-apple-darwin` is 1.49.0.
- Python 3.7 to 3.10 do not have a macOS ARM version.
quark-zju added a commit to quark-zju/rust-cpython that referenced this issue Jul 1, 2024
Drop Python 2.7, as it is no longer available:

    Warning: The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672
    Version 2.7 was not found in the local cache
    Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 22.04.
    The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Add Python 3.12 as its support was just added.

Fork macOS steps from Linux due to the ARM arch change:

- Rust 1.41 does not have a `aarch64-apple-darwin` version. The first Rust
  version that supports `aarch64-apple-darwin` is 1.49.0.
- Python 3.7 to 3.10 do not have a macOS ARM version.
quark-zju added a commit to quark-zju/rust-cpython that referenced this issue Jul 1, 2024
Drop Python 2.7, as it is no longer available:

    Warning: The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672
    Version 2.7 was not found in the local cache
    Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 22.04.
    The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Add Python 3.12 as its support was just added.

Fork macOS steps from Linux due to the ARM arch change:

- Rust 1.41 does not have a `aarch64-apple-darwin` version. The first Rust
  version that supports `aarch64-apple-darwin` is 1.49.0.
- Python 3.7 to 3.10 do not have a macOS ARM version in CI.
- Rust < 1.54 will fail on CI. See also See rust-lang/rust#107252:

    error: linking with `cc` failed: exit status: 1
    |
    = note: "cc" "-arch" "arm64" "-L" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.0.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.1.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.10.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.11.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.12.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.13.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.14.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.15.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.2.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.3.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.4.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.5.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.6.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.7.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.8.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.9.rcgu.o" "-o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.1dr67yq0qjg3o93v.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/deps" "-L" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-dd5aba3397285ad0.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-cb187f1a5b379d1a.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-d263574460ac0b7b.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-0a9a23101265d9a7.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-e6457880b831342b.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-9590d4ced205b108.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-a1f4d95a4a2cc2a3.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-dbf1072a4ef077a4.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-7ff002204e919c46.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-a2049ddc023c32b9.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-02cf13a7707ef825.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-e628929d2a4d215f.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-1f245a76196b996b.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-49a44db0ac13b7f4.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-a04810d031c48fa4.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-7cd54448073dfb2c.rlib" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv"
    = note: ld: multiple errors: archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-dd5aba3397285ad0.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-cb187f1a5b379d1a.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-d263574460ac0b7b.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-0a9a23101265d9a7.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-e6457880b831342b.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-9590d4ced205b108.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-a1f4d95a4a2cc2a3.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-dbf1072a4ef077a4.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-7ff002204e919c46.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-a2049ddc023c32b9.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-02cf13a7707ef825.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-e628929d2a4d215f.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-1f245a76196b996b.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-49a44db0ac13b7f4.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-a04810d031c48fa4.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-7cd54448073dfb2c.rlib'
            clang: error: linker command failed with exit code 1 (use -v to see invocation)
swaroopch pushed a commit to swaroopch/edn_format that referenced this issue Jul 5, 2024
* CI: test on 3.11 and 3.12 as well

* CI: pin Ubuntu version to fix Python 3.6

See actions/setup-python#544

* CI: remove 2.7 support to fix build

See actions/setup-python#672

* Bump actions/setup-python to v5
guyer added a commit to usnistgov/steppyngstounes that referenced this issue Jan 8, 2025
GitHub no longer supports setup-python 2.7
actions/setup-python#672
gyst added a commit to collective/collective.collabora that referenced this issue Mar 3, 2025
gyst added a commit to collective/collective.collabora that referenced this issue Mar 3, 2025
EmberCraze added a commit to gigapay/python-stdnum that referenced this issue Apr 10, 2025
* Switch from nose to pytest

Nose hasn't seen a release since 2015 and sadly doesn't work with Python
3.10.

See nose-devs/nose#1099

* Upgrade to CodeQL Action v2

https://github.blog/changelog/2022-04-27-code-scanning-deprecation-of-codeql-action-v1/

* Fix flake8 error

This stops using not as a function and hopefully also makes the logic
clearer.

* Upgrade GitHub Actions

Update checkout to v3 (no relevant changes) and setup-python to v4
(changes the names for pypy versions).

* Add support for Python 3.10

* Put long line flake8 ignores in files instead of globally

We have some long URLs in the code (mostly in docstrings) and wrapping
them does not improve readability (and is difficult in docstrings) so
the E501 ignore is now put inside each file instead of globally.

Closes arthurdejong/python-stdnum#302

* Fix small typo

Improper inflection of plurals.

Closes arthurdejong/python-stdnum#299

* Add Czech bank account numbers

Closes arthurdejong/python-stdnum#295
Closes arthurdejong/python-stdnum#296

* Use str.zfill() for padding leading zeros

* Add extra court alias for german Handelsregisternummer

Charlottenburg (Berlin) is a valid court representation for Berlin
(Charlottenburg).

See https://www.northdata.com/VRB+Service+GmbH,+Berlin/Amtsgericht+Charlottenburg+%28Berlin%29+HRB+103587+B

Closes arthurdejong/python-stdnum#298

* Remove redundant steps with tox_job

This also switches the other Tox jobs to use the latest Python 3.x
interpreter.

Closes arthurdejong/python-stdnum#305

* Update ISIL download URL

* Provide a timeout to all download scripts

* Update names of Wikipedia pages with IMSI codes

* Ignore invalid downloaded country codes

The page currently lists a country without a country code (is listed as
"-"). This also ensures that lists of country codes are handled
consistently.

* Do not print trailing space

* Update database files

* Fix German OffeneRegister company registry URL

* Update EU VAT Vies test with new number

The number used before was apparently no longer valid.

* Add support for Tunisia TIN

Closes arthurdejong/python-stdnum#317
Closes arthurdejong/python-stdnum#309

* Add Kenyan TIN

Closes arthurdejong/python-stdnum#300
Closes arthurdejong/python-stdnum#310

* Add support for Morocco TIN

Closes arthurdejong/python-stdnum#226
Closes arthurdejong/python-stdnum#312

* Add Algerian NIF number

This currently only checks the length and whether it only contains
digits because little could be found on the structure of the number of
whether there are any check digits.

Closes arthurdejong/python-stdnum#313
Closes arthurdejong/python-stdnum#307

* Fix a couple typos found by codespell

Closes arthurdejong/python-stdnum#333

* Add North Macedonian ЕДБ

Note that this is implementation is mostly based on unofficial sources
describing the format, which match the hundreds of examples found
online.
https://forum.it.mk/threads/modularna-kontrola-na-embg-edb-dbs-itn.15663/?__cf_chl_tk=Op2PaEIauip6Z.ZjvhP897O8gRVAwe5CDAVTpjx1sEo-1663498930-0-gaNycGzNCRE#post-187048

Also note that the algorithm for the check digit was tested on all found
examples, and it doesn't work for all of them, despite those failing
examples don't seem to be valid according to the official online search.

Closes arthurdejong/python-stdnum#330
Closes arthurdejong/python-stdnum#222

* Add Faroe Islands V-number

Closes arthurdejong/python-stdnum#323
Closes arthurdejong/python-stdnum#219

* Add support for Montenegro TIN

Closes arthurdejong/python-stdnum#331
Closes arthurdejong/python-stdnum#223

* Add CAS Registry Number

* Add support for Ghana TIN

Closes arthurdejong/python-stdnum#326
Closes arthurdejong/python-stdnum#262

* Support running tests with PyPy 2.7

This also applies the fix from cfc80c8 from Python 2.7 to PyPy.

* Update Fødselsnummer test case for date in future

The future was now. This problem was pushed forwards to October 2039.

* Remove duplicate CAS Registry Number

The recently added stdnum.cas module was already available as teh
stdnum.casrn module.

Reverts acb6934

* Improve validation of CAS Registry Number

This ensures that a leading 0 is treated as invalid.

* Remove unused import

Fixes 09d595b

* Switch to parse_qs() from urllib.parse

The function was removed from the cgi module in Python 3.8.

* Switch to escape() from html

The function was removed from the cgi module in Python 3.8.

* Support "I" and "O" in CUSIP number

It is unclear why these letters were considered invalid at the time of
the implementation.

This also reduces the test set a bit while still covering most cases.

Closes arthurdejong/python-stdnum#337

* Add a check_uid() function to the stdnum.ch.uid module

This function can be used to performa a lookup of organisation
information by the Swiss Federal Statistical Office web service.

Related to arthurdejong/python-stdnum#336

* Make all exceptions inherit from ValueError

All the validation exceptions (subclasses of ValidationError) are raised
when a number is provided with an inappropriate value.

* Pad with zeroes in a more readable manner

Closes arthurdejong/python-stdnum#340

* Use HTTPS in URLs where possible

* Ensure we always run flake8-bugbear

This assumes that we no longer use Python 2.7 for running the flake8
tests any more.

* Add support for Slovenian EMŠO (Unique Master Citizen Number)

Closes arthurdejong/python-stdnum#338

* Add Pakistani ID card number

Based on the implementation provided by Quantum Novice (Syed Haseeb
Shah).

Closes arthurdejong/python-stdnum#306
Closes arthurdejong/python-stdnum#304

* vatin: Add a few more tests for is_valid

See arthurdejong/python-stdnum#316

* Pick up custom certificate from script path

This ensures that the script can be run from any directory.

Fixes c4ad714

* Increase timeout for CN Open Data download

It seems that raw.githubusercontent.com can be extremely slow.

* Update German OffeneRegister lookup data format

It appears that the data structure at OffeneRegister has changed which
requires a different query. Data is returned in a different structure.

* Update database files

* Get files ready for 1.18 release

* Avoid newer flake8

The new 6.0.0 contains a number of backwards incompatible changes
for which plugins need to be updated and configuration needs to be
updated.

Sadly the maintainer no longer accepts contributions or discussion
See PyCQA/flake8#1760

* Fix a typo

Clocses arthurdejong/python-stdnum#341

* Run Python 3.5 and 3.6 GitHub tests on older Ubuntu

The ubuntu-latest now points to ubuntu-22.04 instead of ubuntu-20.04
before.

This also switches the PyPy version to test with to 3.9.

* Fix typos found by codespell

Closes arthurdejong/python-stdnum#344

* Add initial CONTRIBUTING.md file

Initial description of the information needed for adding new number
formats and some coding and testing guidelines.

* Add support for Egypt TIN

This also convertis Arabic digits to ASCII digits.

Closes arthurdejong/python-stdnum#225
Closes arthurdejong/python-stdnum#334

* Extend number properties to show in online check

This also ensures that flake8 is run on the WSGI script.

* Fix typo in UEN docstring

* Fix Albanian tax number validation

This extends the description of the Albanian NIPT (NUIS) number with
information on the structure of the number. The first character was
previously limited between J and L but this letter indicates a decade
and the number is also used for individuals to where it indicates a
birth date.

Thanks Julien Launois for pointing this out.

Source: https://www.oecd.org/tax/automatic-exchange/crs-implementation-and-assistance/tax-identification-numbers/Albania-TIN.pdf

Fixes 3db826c
Closes arthurdejong/python-stdnum#402

* Update IBAN database file

Closes arthurdejong/python-stdnum#409

* Extend date parsing in GS1-128

Some new AIs have new date formats or have changed the way optional
components of formats are defined.

* Fix date formatting on PyPy 2.7

The original way of calling strftime was likely an artifact of Python
2.6 support.

Fixes 7e84c05

* Add support for Python 3.11

* Ensure flake8 is run on all Python files

This also fixes code style fixes in the Sphinx configuration file.

* Add get_county() function to Romanian CNP

This also validates the county part of the number.

Closes arthurdejong/python-stdnum#407

* Add functionality to get gender from Belgian National Number

This also extends the documentation for the number.

Closes https://github.com/arthurdejong/python-stdnum/pull/347/files

* Add support for Finland HETU new century indicating signs

More information at https://dvv.fi/en/reform-of-personal-identity-code

Cloess arthurdejong/python-stdnum#396

* Add Spanish postcode validator

Closes arthurdejong/python-stdnum#401

* Add support for Guinea TIN

Closes arthurdejong/python-stdnum#384
Closes arthurdejong/python-stdnum#386

* Add automated checking for correct license header

* Minor ISSN and ISBN documentation fixes

Fix a comment that claimed incorrect ISSN length and use slightly more
consistent terminology around check digits in ISSN and ISBN.

Closes arthurdejong/python-stdnum#415

* Handle (partially) unknown birthdate of Belgian National Number

This adds documentation for the special cases regarding birth dates
embedded in the number, allows for date parts to be unknown and adds
functions for getting the year and month.

Closes arthurdejong/python-stdnum#416

* Run Python 2.7 tests in a container for GitHub Actions

See actions/setup-python#672

* Add Belgian BIS Number

Closes arthurdejong/python-stdnum#418

* Validate first digit of Canadian SIN

See http://www.straightlineinternational.com/docs/vaildating_canadian_sin.pdf
See https://lists.arthurdejong.org/python-stdnum-users/2023/msg00000.html

* Fix file headers

This improves consistency across files and fixes some files that had an
incorrect file name reference.

* Extend license check to file header check

This also checks that the file name referenced in the file header is
correct.

* Add Slovenian Corporate Registration Number

Closes arthurdejong/python-stdnum#414

* Validate European VAT numbers with EU or IM prefix

Closes arthurdejong/python-stdnum#417

* Remove EU NACE update script

The website that publishes the NACE catalogue has changed and a complete
re-write of the script would be necessary. The data file hasn't changed
since 2017 so is also unlikely to change until it is going to be
replaced by NACE rev. 2.1 in 2025.

See https://ec.europa.eu/eurostat/web/nace

The NACE rev 2 specification can now be found here:
https://showvoc.op.europa.eu/#/datasets/ESTAT_Statistical_Classification_of_Economic_Activities_in_the_European_Community_Rev._2/data

The NACE rev 2.1 specification can now be found here:
https://showvoc.op.europa.eu/#/datasets/ESTAT_Statistical_Classification_of_Economic_Activities_in_the_European_Community_Rev._2.1._%28NACE_2.1%29/data

In both cases a ZIP file with RDF metadata can be downloaded (but the
web applciation also exposes some simpler JSON APIs).

* Update database files

This also modifies the OUI update script because the website has changed
to HTTPS and is sometimes very slow.

The Belgian Commerzbank no longer has a registration and a bank account
number in the tests used that bank.

* Replace test number for German company registry

The number seems to be no longer valid breaking the online tests.

* Update Belarusian UNP online check

The API for the online check for Belarusian UNP numbers at
https://www.portal.nalog.gov.by/grp/getData has changed some small
details of the API.

* Rename license_file option in setup.cfg

It seems the old option wasn't working with all versions of setuptools
anyway.

See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html

* Avoid the deprecated assertRegexpMatches function

* Use importlib.resource in place of deprecated pkg_resources

Closes arthurdejong/python-stdnum#412
Closes arthurdejong/python-stdnum#413

* Remove obsolete intermediate certificate

The portal.nalog.gov.by web no longer has an incomplete certificate
chain.

* Ensure all files are included in source archive

Fixes b1dc313
Fixes 90044e2

* Get files ready for 1.19 release

* Add support for Python 3.12

* Fix typo (thanks Александр Кизеев)

* Ensure EU VAT numbers don't accept duplicate country codes

* Add British Columbia PHN

Closes arthurdejong/python-stdnum#421

* Add European Community (EC) Number

Closes arthurdejong/python-stdnum#422

* Fix vatin number compacting for "EU" VAT numbers

Thanks Davide Walder for finding this.

Closes arthurdejong/python-stdnum#427

* Imporve French NIF validation (checksum)

The last 3 digits are a checksum.  % 511
https://ec.europa.eu/taxation_customs/tin/specs/FS-TIN%20Algorithms-Public.docx

Closes arthurdejong/python-stdnum#426

* Fix Ukrainian EDRPOU check digit calculation

This fixes the case where the weighted sum woud be 10 which should
result in a check digit of 0.

Closes arthurdejong/python-stdnum#429

* Add Indian virtual identity number

Closes arthurdejong/python-stdnum#428

* Use HTTPS in URLs where possible

* Switch to using openpyxl for parsing XLSX files

The xlrd has dropped support for parsing XLSX files. We still use xlrd
for update/be_banks.py because they use the classic XLS format and
openpyxl does not support that format.

* Add update-dat tox target for convenient data file updating

* Update database files

The Belgian bpost bank no longer has a registration and a few bank
account numbers in the tests that used that bank were removed.

Also updates the update/gs1_ai.py script to handle the new format of the
data published by GS1. Also update the GS1-128 module to handle some
different date formats.

The Pakistan entry was kept in the stdnum/iban.dat file because the PDF
version of the IBAN Registry still contains the country.

fix db

* Get files ready for 1.20 release

* Drop support for Python 3.5

We don't have an easy way to test with Python 3.5 any more.

* Add support for Indonesian NIK

* Fix a typo

Closes arthurdejong/python-stdnum#443

* Update Irish PPS validator to support new numbers

See https://www.charteredaccountants.ie/News/b-range-pps-numbers

Closes arthurdejong/python-stdnum#440
Closes arthurdejong/python-stdnum#441

* Update Czech database files

Closes arthurdejong/python-stdnum#439
Closes arthurdejong/python-stdnum#435

* Adjust Swiss uid module to accept numbers without CHE prefix

Closes arthurdejong/python-stdnum#437
Closes arthurdejong/python-stdnum#423

* Support 16 digit Indonesian NPWP numbers

The Indonesian NPWP is being switched from 15 to 16 digits. The number
is now the NIK for Indonesian citizens and the old format with a leading
0 for others (organisations and non-citizens).

See https://www.grantthornton.co.id/insights/global-insights1/updates-regarding-the-format-of-indonesian-tax-id-numbers/

Closes arthurdejong/python-stdnum#432

* Replace use of deprecated inspect.getargspec()

Use the inspect.signature() function instead. The inspect.getargspec()
function was removed in Python 3.11.

* Add Belgian SSN number

Closes arthurdejong/python-stdnum#438

* Fix zeep client timeout parameter

The timeout parameter of the zeep transport class is not responsable for
POST/GET timeouts. The operational_timeout parameter should be used for
that.

See mvantellingen/python-zeep#140

Closes arthurdejong/python-stdnum#444
Closes arthurdejong/python-stdnum#445

* Customise certificate validation for web services

This adds a `verify` argument to all functions that use network services
for lookups. The option is used to configure how certificate validation
works, the same as in the requests library.

For SOAP requests this is implemented properly when using the Zeep
library. The implementations using Suds and PySimpleSOAP have been
updated on a best-effort basis but their use has been deprecated because
they do not seem to work in practice in a lot of cases already.

Related to arthurdejong/python-stdnum#452
Related to arthurdejong/python-stdnum#453

* Add Dutch identiteitskaartnummer

Closes arthurdejong/python-stdnum#449

* Add Belgian eID card number

Closes arthurdejong/python-stdnum#448

* Ensure get_soap_client() caches with verify

This fixes the get_soap_client() function to cache SOAP clients taking
the verify argument into account.

Fixes 3fcebb2

* Ignore deprecation warnings in flake8 target

This silences a ton of ast deprecation warnings that we can't fix in
python-stdnum anyway.

* Add more tests for Verhoeff implementation

See arthurdejong/python-stdnum#456

* Use older Github runner for Python 3.7 tests

* Add missing music industry ISRC country codes

Closes arthurdejong/python-stdnum#455
Closes arthurdejong/python-stdnum#454

* Allow Uruguay RUT number starting with 22

* Drop Python 2 support

This deprecates the stdnum.util.to_unicode() function because we no
longer have to deal with bytestrings.

* Add International Standard Name Identifier

Closes arthurdejong/python-stdnum#463

* Support Ecuador public RUC with juridical format

It seems that numbers with a format used for juridical RUCs have been
issued to companies.

Closes arthurdejong/python-stdnum#457

* Add Spanish CAE Number

Closes arthurdejong/python-stdnum#446

* Add Russian ОГРН

Closes arthurdejong/python-stdnum#459

* Add support for Python 3.13

* Fix Czech Rodné číslo check digit validation

It seems that a small minority of numbers assigned with a checksum of 10
are still valid and expected to have a check digit value of 0. According
to https://www.domzo13.cz/sw/evok/help/born_numbers.html this practice
even happended (but less frequently) after 1985.

Closes arthurdejong/python-stdnum#468

* Drop more Python 2.7 compatibility code

* Ignore test failures from www.dgii.gov.do

There was a change in the SOAP service and there is a new URL. However,
the API has changed and seems to require authentication.

We ignore test failures for now but unless a solution is found the DGII
validation will be removed.

See: arthurdejong/python-stdnum#462
See: arthurdejong/python-stdnum#461

---------

Co-authored-by: Arthur de Jong <arthur@arthurdejong.org>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: vovavili <64227274+vovavili@users.noreply.github.com>
Co-authored-by: petr.prikryl <petr.prikryl@olc.cz>
Co-authored-by: Romuald R <romualdr@users.noreply.github.com>
Co-authored-by: Leandro Regueiro <leandro.regueiro@gmail.com>
Co-authored-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
Co-authored-by: Blaž Bregar <blaz@aklaro.si>
Co-authored-by: valeriko <valerij.koort@gmail.com>
Co-authored-by: Ali-Akber Saifee <ali@indydevs.org>
Co-authored-by: RaduBorzea <101399404+RaduBorzea@users.noreply.github.com>
Co-authored-by: Jeff Horemans <jeff.horemans@vortex-financials.be>
Co-authored-by: mjturt <maks.turtiainen@gmail.com>
Co-authored-by: Victor <victor@calidae.com>
Co-authored-by: Chales Horn <charles.horn@gmail.com>
Co-authored-by: Blaž Bregar <blaz@vexo.systems>
Co-authored-by: Ömer Boratav <omerboratav@gmail.com>
Co-authored-by: Daniel Weber <weberdk01@gmail.com>
Co-authored-by: Kevin Dagostino <kevin@tonkworks.com>
Co-authored-by: Atul Deolekar <atul.deolekar@gmail.com>
Co-authored-by: vanderkoort <vanderkoort@gmail.com>
Co-authored-by: Olly Middleton <olly@wegotpop.com>
Co-authored-by: Joris Makauskis <jmak@odoo.com>
Co-authored-by: Victor Sordoillet <victor@groover.co>
Co-authored-by: Quique Porta <me@quiqueporta.com>
Co-authored-by: nvmbrasserie <ivan@opensanctions.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests