liburlparser 1.4.6__tar.gz → 1.6.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. liburlparser-1.6.1/.github/workflows/cmake.yml +79 -0
  2. liburlparser-1.6.1/.github/workflows/docs.yml +72 -0
  3. liburlparser-1.6.1/.github/workflows/wheels.yml +124 -0
  4. liburlparser-1.6.1/.gitmodules +7 -0
  5. liburlparser-1.6.1/CMakeLists.txt +230 -0
  6. {liburlparser-1.4.6 → liburlparser-1.6.1}/PKG-INFO +11 -6
  7. {liburlparser-1.4.6 → liburlparser-1.6.1}/README.md +5 -1
  8. {liburlparser-1.4.6/cmake/modules → liburlparser-1.6.1/cmake}/PyProject.cmake +0 -0
  9. liburlparser-1.6.1/docs/cpp/Doxyfile.in +63 -0
  10. liburlparser-1.6.1/docs/cpp/header.html +31 -0
  11. liburlparser-1.6.1/docs/cpp/images/interface-arch.svg +1 -0
  12. liburlparser-1.6.1/docs/cpp/images/url-parsing-process.svg +1 -0
  13. liburlparser-1.6.1/docs/cpp/mainpage.md +260 -0
  14. liburlparser-1.6.1/docs/python/docs/api/host.md +409 -0
  15. liburlparser-1.6.1/docs/python/docs/api/psl.md +97 -0
  16. liburlparser-1.6.1/docs/python/docs/api/url.md +277 -0
  17. liburlparser-1.6.1/docs/python/docs/examples.md +236 -0
  18. liburlparser-1.6.1/docs/python/docs/index.md +86 -0
  19. liburlparser-1.6.1/docs/python/docs/installation.md +91 -0
  20. liburlparser-1.6.1/docs/python/docs/performance.md +178 -0
  21. liburlparser-1.6.1/docs/python/docs/usage/advanced.md +541 -0
  22. liburlparser-1.6.1/docs/python/docs/usage/basic.md +162 -0
  23. liburlparser-1.6.1/docs/python/docs/usage/cli.md +15 -0
  24. liburlparser-1.6.1/docs/python/mkdocs.yml +39 -0
  25. {liburlparser-1.4.6 → liburlparser-1.6.1}/examples/main.cpp +1 -1
  26. {liburlparser-1.4.6 → liburlparser-1.6.1}/include/urlparser.h +152 -29
  27. liburlparser-1.6.1/public_suffix_list.dat +15790 -0
  28. {liburlparser-1.4.6 → liburlparser-1.6.1}/pyproject.toml +10 -7
  29. liburlparser-1.6.1/src/binding/about.cpp +19 -0
  30. {liburlparser-1.4.6/src/binding → liburlparser-1.6.1/src/binding/bind_core}/main.cpp +2 -6
  31. liburlparser-1.6.1/src/liburlparser/__init__.py +12 -0
  32. liburlparser-1.6.1/src/liburlparser/__main__.py +44 -0
  33. {liburlparser-1.4.6 → liburlparser-1.6.1}/src/liburlparser/core.py +4 -1
  34. liburlparser-1.6.1/src/liburlparser/utils.py +18 -0
  35. liburlparser-1.6.1/tests/python/test_cli_subprocess.py +122 -0
  36. {liburlparser-1.4.6 → liburlparser-1.6.1}/tests/python/test_extra.py +1 -1
  37. liburlparser-1.4.6/.github/workflows/cmake.yml +0 -44
  38. liburlparser-1.4.6/.github/workflows/wheels.yml +0 -98
  39. liburlparser-1.4.6/.gitmodules +0 -4
  40. liburlparser-1.4.6/.ruff_cache/.gitignore +0 -1
  41. liburlparser-1.4.6/.ruff_cache/0.2.1/17168405204037786600 +0 -0
  42. liburlparser-1.4.6/.ruff_cache/0.2.1/17509219516083451397 +0 -0
  43. liburlparser-1.4.6/.ruff_cache/CACHEDIR.TAG +0 -1
  44. liburlparser-1.4.6/CMakeLists.txt +0 -175
  45. liburlparser-1.4.6/docs/Doxyfile.in +0 -19
  46. liburlparser-1.4.6/src/liburlparser/__init__.py +0 -7
  47. liburlparser-1.4.6/src/liburlparser/__main__.py +0 -33
  48. {liburlparser-1.4.6 → liburlparser-1.6.1}/.clang-format +0 -0
  49. {liburlparser-1.4.6 → liburlparser-1.6.1}/.gitignore +0 -0
  50. {liburlparser-1.4.6 → liburlparser-1.6.1}/LICENSE +0 -0
  51. {liburlparser-1.4.6 → liburlparser-1.6.1}/conda.recipe/meta.yaml +0 -0
  52. {liburlparser-1.4.6 → liburlparser-1.6.1}/docs/images/logo/liburlparser-logo-1.svg +0 -0
  53. {liburlparser-1.4.6 → liburlparser-1.6.1}/docs/images/logo/liburlparser-logo-2.svg +0 -0
  54. {liburlparser-1.4.6 → liburlparser-1.6.1}/examples/common.h +0 -0
  55. {liburlparser-1.4.6 → liburlparser-1.6.1}/src/psl.cpp +0 -0
  56. {liburlparser-1.4.6 → liburlparser-1.6.1}/src/psl.h +0 -0
  57. {liburlparser-1.4.6 → liburlparser-1.6.1}/src/url.cpp +0 -0
  58. {liburlparser-1.4.6 → liburlparser-1.6.1}/src/url.h +0 -0
  59. {liburlparser-1.4.6 → liburlparser-1.6.1}/src/urlparser_host.cpp +0 -0
  60. {liburlparser-1.4.6 → liburlparser-1.6.1}/src/urlparser_url.cpp +0 -0
  61. {liburlparser-1.4.6 → liburlparser-1.6.1}/tests/cpp/common.h +0 -0
  62. {liburlparser-1.4.6 → liburlparser-1.6.1}/tests/cpp/test_host.cpp +0 -0
  63. {liburlparser-1.4.6 → liburlparser-1.6.1}/tests/cpp/test_url.cpp +0 -0
  64. {liburlparser-1.4.6 → liburlparser-1.6.1}/tests/data/host_data.csv +0 -0
  65. {liburlparser-1.4.6 → liburlparser-1.6.1}/tests/data/url_data.csv +0 -0
  66. {liburlparser-1.4.6 → liburlparser-1.6.1}/tests/python/test_host.py +0 -0
  67. {liburlparser-1.4.6 → liburlparser-1.6.1}/tests/python/test_url.py +0 -0
@@ -0,0 +1,79 @@
1
+ name: CPP_BUILD_TEST_DOC
2
+ on:
3
+ workflow_dispatch:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - master
8
+ release:
9
+ types:
10
+ - published
11
+
12
+
13
+ concurrency:
14
+ group: ${{ github.workflow }}-${{ github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ jobs:
18
+ build-project:
19
+ name: Build Project
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - name: Checkout the repository
23
+ uses: actions/checkout@v4
24
+ with:
25
+ submodules: true
26
+
27
+ # - name: Installing required packages
28
+ # run: sudo apt install -y build-essential cmake # libgtest-dev libgmock-dev
29
+
30
+ - name: Configure the project
31
+ uses: threeal/cmake-action@v1.3.0
32
+ with:
33
+ options: BUILD_PYTHON=on
34
+
35
+ # Step 3: Determine release type
36
+
37
+ - name: Build the project
38
+ run: cmake --build build
39
+
40
+ - name: Test the project
41
+ run: ctest --test-dir build -V
42
+
43
+ # - uses: actions/upload-artifact@v4
44
+ # with:
45
+ # path: build/*urlparser*
46
+
47
+ - name: Create ZIP archive
48
+ uses: vimtor/action-zip@v1.2
49
+ with:
50
+ files: build/*urlparser*
51
+ recursive: true
52
+ dest: liburlparser-build-ubuntu.zip
53
+
54
+
55
+ - name: Determine release type
56
+ id: release_type
57
+ run: |
58
+ if [[ "${{ github.ref }}" =~ ^refs/tags/v.*$ ]]; then
59
+ echo "RELEASE_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
60
+ echo "IS_TAG=true" >> $GITHUB_ENV
61
+ else
62
+ echo "RELEASE_NAME=__beta__" >> $GITHUB_ENV
63
+ echo "IS_TAG=false" >> $GITHUB_ENV
64
+ fi
65
+ shell: bash # Use bash for all platforms
66
+
67
+
68
+
69
+ # Step 4: Create or update release
70
+ - name: Create or update release
71
+ id: create_release
72
+ uses: softprops/action-gh-release@v2
73
+ with:
74
+ tag_name: ${{ env.RELEASE_NAME }}
75
+ name: ${{ env.RELEASE_NAME }}
76
+ draft: false
77
+ prerelease: ${{ env.IS_TAG == 'false' }}
78
+ files: dist/*
79
+ token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,72 @@
1
+ name: Build and Deploy Documentation
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ release:
8
+ types: [published]
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ python-docs:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout
16
+ uses: actions/checkout@v3
17
+ with:
18
+ fetch-depth: 0
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v4
22
+ with:
23
+ python-version: '3.x'
24
+
25
+ - name: Install dependencies
26
+ run: pip install mkdocs
27
+
28
+ - name: Build
29
+ run: |
30
+ cd docs/python
31
+ mkdocs build
32
+
33
+ - name: Deploy
34
+ uses: JamesIves/github-pages-deploy-action@v4
35
+ with:
36
+ folder: docs/python/site
37
+ branch: gh-pages
38
+ target-folder: docs/python
39
+
40
+
41
+ cpp-docs:
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - name: Checkout
45
+ uses: actions/checkout@v3
46
+ with:
47
+ fetch-depth: 0
48
+ submodules: true
49
+
50
+ - name: Install Doxygen
51
+ run: sudo apt-get install -y doxygen graphviz
52
+
53
+ - name: Configure CMake
54
+ run: cmake -B build
55
+
56
+ - name: Generate Doxygen documentation
57
+ run: cmake --build build --target docs
58
+
59
+ - name: Deploy
60
+ uses: JamesIves/github-pages-deploy-action@v4
61
+ with:
62
+ folder: build/html
63
+ branch: gh-pages
64
+ target-folder: docs/cpp
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
@@ -0,0 +1,124 @@
1
+ name: PYTHON_BUILD_TEST_DEPLOY
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - master
9
+ tags:
10
+ - "v*"
11
+
12
+ env:
13
+ FORCE_COLOR: 3
14
+
15
+ concurrency:
16
+ group: github.workflow−{{ github.workflow }}-{{ github.ref }}
17
+ cancel-in-progress: true
18
+
19
+ jobs:
20
+ build_sdist:
21
+ name: Build SDist
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ with:
26
+ submodules: false
27
+
28
+ - uses: actions/setup-python@v4
29
+ with:
30
+ python-version: "3.x"
31
+
32
+ # - name: Ruff Check
33
+ # run: pipx run ruff check .
34
+
35
+ - name: Build SDist
36
+ run: pipx run build --sdist
37
+
38
+ - name: Check metadata
39
+ run: pipx run twine check dist/*
40
+
41
+ - uses: actions/upload-artifact@v4
42
+ with:
43
+ path: dist/*.tar.gz
44
+ overwrite: true
45
+
46
+
47
+ build_wheels:
48
+ name: Wheels on ${{ matrix.os }}
49
+ runs-on: ${{ matrix.os }}
50
+ strategy:
51
+ fail-fast: true
52
+ matrix:
53
+ os: [ubuntu-latest, windows-latest]
54
+
55
+ steps:
56
+ - uses: actions/checkout@v4
57
+ with:
58
+ submodules: true
59
+
60
+ - name: Build wheels
61
+ uses: pypa/cibuildwheel@v2.16.5
62
+ env:
63
+ # CIBW_ARCHS_MACOS: universal2
64
+ # CIBW_ARCHS_WINDOWS: auto ARM64
65
+ # Disable building PyPy wheels on all platforms
66
+ CIBW_SKIP: pp*
67
+ # CIBW_PRERELEASE_PYTHONS: true
68
+
69
+ - name: Verify clean directory
70
+ run: git diff --exit-code
71
+ shell: bash
72
+
73
+ - uses: actions/upload-artifact@v4
74
+ with:
75
+ name: wheelhouse-${{ matrix.os }}
76
+ path: wheelhouse/*.whl
77
+ overwrite: false
78
+
79
+
80
+ release:
81
+ name: Release Assets and Upload to PyPI
82
+ needs: [build_wheels, build_sdist]
83
+ runs-on: ubuntu-latest
84
+
85
+ steps:
86
+ # Determine release type
87
+ - name: Determine release type
88
+ id: release_type
89
+ run: |
90
+ if [[ "${{ github.ref }}" =~ ^refs/tags/v.*$ ]]; then
91
+ echo "RELEASE_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
92
+ echo "IS_TAG=true" >> $GITHUB_ENV
93
+ else
94
+ echo "RELEASE_NAME=__beta__" >> $GITHUB_ENV
95
+ echo "IS_TAG=false" >> $GITHUB_ENV
96
+ fi
97
+ shell: bash # Use bash for all platforms
98
+
99
+ - uses: actions/download-artifact@v4
100
+ with:
101
+ path: dist
102
+ merge-multiple: true
103
+
104
+
105
+ - name: List dist directory
106
+ run: tree --du -shaC . # Ensure the directory is not empty
107
+
108
+ - name: Create or update release
109
+ id: create_release
110
+ uses: softprops/action-gh-release@v2
111
+ with:
112
+ tag_name: ${{ env.RELEASE_NAME }}
113
+ name: ${{ env.RELEASE_NAME }}
114
+ draft: false
115
+ prerelease: ${{ env.IS_TAG == 'false' }}
116
+ files: dist/*
117
+ token: ${{ secrets.GITHUB_TOKEN }}
118
+
119
+ - name: Publishing to PyPi
120
+ uses: pypa/gh-action-pypi-publish@release/v1
121
+ if: startsWith(github.ref, 'refs/tags/')
122
+ with:
123
+ password: ${{ secrets.PYPI_PASSWORD }}
124
+ user: ${{ secrets.PYPI_USERNAME }}
@@ -0,0 +1,7 @@
1
+ [submodule "third_party/googletest"]
2
+ path = third_party/googletest
3
+ url = https://github.com/google/googletest.git
4
+ shallow = true
5
+ [submodule "third_party/doxygen-awesome-css"]
6
+ path = third_party/doxygen-awesome-css
7
+ url = https://github.com/jothepro/doxygen-awesome-css.git
@@ -0,0 +1,230 @@
1
+ cmake_minimum_required(VERSION 3.19)
2
+
3
+ option(BUILD_PYTHON "export python module" off)
4
+
5
+ set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ version selection")
6
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
7
+ set(CMAKE_CXX_EXTENSIONS OFF)
8
+
9
+
10
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
11
+ include(PyProject)
12
+
13
+
14
+ if(NOT CMAKE_BUILD_TYPE)
15
+ set(CMAKE_BUILD_TYPE Release)
16
+ endif()
17
+
18
+
19
+
20
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "" FORCE)
21
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING "" FORCE)
22
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "" FORCE)
23
+
24
+ project(${PyProject_NAME} LANGUAGES CXX VERSION ${PyProject_VERSION})
25
+ message(STATUS "Project: ${PROJECT_NAME}@v${PROJECT_VERSION}")
26
+
27
+ find_package(Python3 REQUIRED COMPONENTS Interpreter)
28
+
29
+ if(DEFINED SKBUILD)
30
+ set(PYTHON_PROJECT_NAME "${SKBUILD_PROJECT_NAME}")
31
+ elseif(BUILD_PYTHON)
32
+ set(PYTHON_PROJECT_NAME "${CMAKE_BINARY_DIR}")
33
+
34
+ if(NOT PYTHON_REQUIREMENT_INSTALLED)
35
+ execute_process(
36
+ COMMAND "${Python3_EXECUTABLE}" -m pip install
37
+ nanobind ninja pytest-xdist pip-tools # build requirements
38
+ OUTPUT_QUIET COMMAND_ERROR_IS_FATAL ANY
39
+ )
40
+ execute_process(
41
+ COMMAND "${Python3_EXECUTABLE}" -m piptools compile --output-file ${CMAKE_CURRENT_BINARY_DIR}/requirements.txt pyproject.toml
42
+ --no-emit-options --quiet --no-strip-extras --extra test
43
+ OUTPUT_QUIET COMMAND_ERROR_IS_FATAL ANY
44
+ )
45
+ execute_process(
46
+ COMMAND "${Python3_EXECUTABLE}" -m pip install -r ${CMAKE_CURRENT_BINARY_DIR}/requirements.txt
47
+ OUTPUT_QUIET COMMAND_ERROR_IS_FATAL ANY
48
+ )
49
+ set(PYTHON_REQUIREMENT_INSTALLED TRUE CACHE INTERNAL "Python requirements installed")
50
+ endif()
51
+
52
+ execute_process(
53
+ COMMAND "${Python3_EXECUTABLE}" -m nanobind --cmake_dir
54
+ OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE NB_DIR)
55
+
56
+ message(STATUS "Found NanoBind at ${NB_DIR}")
57
+ list(APPEND CMAKE_PREFIX_PATH "${NB_DIR}")
58
+ endif()
59
+
60
+
61
+
62
+ # Download the public suffix list file from the internet
63
+ set(PUBLIC_SUFFIX_LIST_URL "https://publicsuffix.org/list/public_suffix_list.dat")
64
+ set(PUBLIC_SUFFIX_LIST_DAT "public_suffix_list.dat")
65
+ if(NOT DEFINED SKBUILD)
66
+ set(PUBLIC_SUFFIX_LIST_DAT "${CMAKE_CURRENT_BINARY_DIR}/${PUBLIC_SUFFIX_LIST_DAT}")
67
+ endif()
68
+
69
+ # Download the public suffix list file from the internet if not already exists
70
+ if(EXISTS "${PUBLIC_SUFFIX_LIST_DAT}")
71
+ message(STATUS "[DATA] ${PUBLIC_SUFFIX_LIST_DAT} is found.")
72
+ else()
73
+ message(WARNING "[DATA] ${PUBLIC_SUFFIX_LIST_DAT} is not found. Trying to download it.")
74
+ file(DOWNLOAD "${PUBLIC_SUFFIX_LIST_URL}" ${PUBLIC_SUFFIX_LIST_DAT})
75
+ if(EXISTS "${PUBLIC_SUFFIX_LIST_DAT}")
76
+ message(STATUS "[DATA] ${PUBLIC_SUFFIX_LIST_DAT} is downloaded.")
77
+ else()
78
+ message(FATAL_ERROR "[DATA] Failed to download ${PUBLIC_SUFFIX_LIST_DAT}.")
79
+ endif()
80
+ endif()
81
+
82
+ file(GLOB SOURCES ${PROJECT_SOURCE_DIR}/src/*.cpp)
83
+
84
+
85
+ if(DEFINED PYTHON_PROJECT_NAME)
86
+ # Try to import all Python components potentially needed by nanobind
87
+ #set(Python3_FIND_STRATEGY LOCATION)
88
+ find_package(Python 3.8
89
+ REQUIRED COMPONENTS Interpreter Development.Module
90
+ OPTIONAL_COMPONENTS Development.SABIModule)
91
+ # Import nanobind through CMake's find_package mechanism
92
+ find_package(nanobind CONFIG REQUIRED)
93
+
94
+
95
+ set(NB_MODULE _about)
96
+ nanobind_add_module(${NB_MODULE} STABLE_ABI NB_STATIC ${PROJECT_SOURCE_DIR}/src/binding/about.cpp)
97
+ target_compile_definitions(${NB_MODULE} PRIVATE
98
+ VERSION_INFO=${PROJECT_VERSION}
99
+ NB_MODULE_NAME=${NB_MODULE})
100
+
101
+ file(GLOB PYTHON_BIND_MODULES_PATH ${PROJECT_SOURCE_DIR}/src/binding/bind_*)
102
+ set(PYTHON_BIND_MODULES "${NB_MODULE}")
103
+ foreach(NB_MODULE_PATH IN LISTS PYTHON_BIND_MODULES_PATH)
104
+ get_filename_component(NB_MODULE ${NB_MODULE_PATH} NAME)
105
+ string(REGEX REPLACE "bind(.*)" "\\1" NB_MODULE ${NB_MODULE})
106
+ list(APPEND PYTHON_BIND_MODULES ${NB_MODULE})
107
+ file(GLOB NB_MODULE_SOURCES ${NB_MODULE_PATH}/*.cpp)
108
+
109
+ message(STATUS "Found module: ${NB_MODULE}")
110
+
111
+ # Add more commands here to process each directory as needed
112
+
113
+ # We are now ready to compile the actual extension module
114
+ nanobind_add_module(
115
+ # Name of the extension
116
+ ${NB_MODULE}
117
+
118
+ # Target the stable ABI for Python 3.12+, which reduces
119
+ # the number of binary wheels that must be built. This
120
+ # does nothing on older Python versions
121
+ STABLE_ABI
122
+
123
+ # Build libnanobind statically and merge it into the
124
+ # extension (which itself remains a shared library)
125
+ #
126
+ # If your project builds multiple extensions, you can
127
+ # replace this flag by NB_SHARED to conserve space by
128
+ # reusing a shared libnanobind across libraries
129
+ NB_STATIC
130
+
131
+ # Source code goes here
132
+ ${NB_MODULE_SOURCES} ${SOURCES}
133
+ )
134
+
135
+ target_include_directories(${NB_MODULE} PRIVATE include src)
136
+ target_compile_definitions(${NB_MODULE} PRIVATE NB_MODULE_NAME=${NB_MODULE})
137
+ target_compile_definitions(${NB_MODULE} PRIVATE
138
+ DONT_INIT_PSL
139
+ PUBLIC_SUFFIX_LIST_URL="${PUBLIC_SUFFIX_LIST_URL}"
140
+ PUBLIC_SUFFIX_LIST_DAT="${PUBLIC_SUFFIX_LIST_DAT}"
141
+ )
142
+ endforeach()
143
+
144
+ if(DEFINED SKBUILD)
145
+ install(TARGETS ${PYTHON_BIND_MODULES}
146
+ CONFIGURATIONS Release
147
+ LIBRARY DESTINATION
148
+ ${PYTHON_PROJECT_NAME})
149
+ install (FILES ${PUBLIC_SUFFIX_LIST_DAT}
150
+ DESTINATION ${SKBUILD_PROJECT_NAME})
151
+ else()
152
+ file(COPY ${PROJECT_SOURCE_DIR}/src/${PROJECT_NAME} DESTINATION ${PYTHON_PROJECT_NAME})
153
+ file(COPY ${PUBLIC_SUFFIX_LIST_DAT} DESTINATION ${PYTHON_PROJECT_NAME}/${PROJECT_NAME} )
154
+
155
+ foreach(_core IN LISTS PYTHON_BIND_MODULES)
156
+ set_target_properties(${_core} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PYTHON_PROJECT_NAME}/${PROJECT_NAME})
157
+ endforeach()
158
+ endif()
159
+ endif()
160
+
161
+ if(DEFINED SKBUILD)
162
+ RETURN()
163
+ endif()
164
+
165
+
166
+
167
+ add_library(urlparser SHARED ${SOURCES})
168
+ add_library(url::base ALIAS urlparser)
169
+ target_compile_definitions(urlparser PRIVATE
170
+ PUBLIC_SUFFIX_LIST_DAT="${PUBLIC_SUFFIX_LIST_DAT}"
171
+ )
172
+
173
+ target_include_directories(urlparser
174
+ PUBLIC
175
+ ${PROJECT_SOURCE_DIR}/include
176
+ PRIVATE
177
+ ${PROJECT_SOURCE_DIR}/src)
178
+
179
+
180
+ add_executable(example examples/main.cpp)
181
+ target_link_libraries(example PRIVATE url::base)
182
+
183
+ install(TARGETS urlparser
184
+ LIBRARY DESTINATION lib
185
+ ARCHIVE DESTINATION lib
186
+ INCLUDES DESTINATION include
187
+ )
188
+
189
+
190
+
191
+ enable_testing()
192
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest)
193
+ file(GLOB TEST_SOURCES ${PROJECT_SOURCE_DIR}/tests/cpp/*.cpp)
194
+
195
+ add_executable(test_liburlparser ${TEST_SOURCES})
196
+ target_link_libraries(test_liburlparser PRIVATE url::base gtest gtest_main pthread)
197
+ target_include_directories(test_liburlparser PRIVATE ${PROJECT_SOURCE_DIR}/tests/cpp)
198
+ add_test(NAME unitTests COMMAND test_liburlparser)
199
+ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -V DEPENDS test_liburlparser)
200
+
201
+
202
+ if(BUILD_PYTHON)
203
+ add_test(NAME pythonTests
204
+ COMMAND ${Python3_EXECUTABLE} -m pytest -n auto ${PROJECT_SOURCE_DIR}/tests/python
205
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
206
+ )
207
+ endif()
208
+
209
+
210
+
211
+ # Find Doxygen package
212
+ find_package(Doxygen)
213
+ message(STATUS "Doxygen_FOUND : ${Doxygen_FOUND}")
214
+ # Find Doxygen package
215
+ if (Doxygen_FOUND)
216
+ # Configure Doxyfile.in template
217
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/cpp/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
218
+
219
+ # Add target to generate documentation
220
+ add_custom_target(docs
221
+ COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
222
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
223
+ COMMENT "Generating Doxygen documentation"
224
+ VERBATIM
225
+ )
226
+ endif ()
227
+
228
+
229
+
230
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: liburlparser
3
- Version: 1.4.6
3
+ Version: 1.6.1
4
4
  Summary: Fastest Url parser in the world
5
5
  Author-Email: Mohammad Raziei <mohammadraziei1375@gmail.com>
6
6
  Classifier: Development Status :: 4 - Beta
@@ -13,16 +13,17 @@ Classifier: Programming Language :: Python :: 3.8
13
13
  Classifier: Programming Language :: Python :: 3.9
14
14
  Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
16
17
  Project-URL: Homepage, https://github.com/mohammadraziei/liburlparser
17
- Project-URL: Bug tracker, https://github.com/mohammadraziei/liburlparser/issues
18
+ Project-URL: Bug Tracker, https://github.com/mohammadraziei/liburlparser/issues
18
19
  Project-URL: Document, https://mohammadraziei.github.io/liburlparser/latest
19
20
  Requires-Python: >=3.8
20
21
  Requires-Dist: filelock
21
- Requires-Dist: pytest; extra == "test"
22
- Requires-Dist: requests; extra == "test"
23
- Requires-Dist: requests; extra == "online"
24
22
  Provides-Extra: test
23
+ Requires-Dist: pytest-xdist; extra == "test"
24
+ Requires-Dist: requests; extra == "test"
25
25
  Provides-Extra: online
26
+ Requires-Dist: requests; extra == "online"
26
27
  Description-Content-Type: text/markdown
27
28
 
28
29
  <p align="center">
@@ -54,6 +55,7 @@ Description-Content-Type: text/markdown
54
55
  [![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-white.svg)](https://sonarcloud.io/summary/new_code?id=MohammadRaziei_liburlparser)
55
56
 
56
57
  [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=MohammadRaziei_liburlparser&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=MohammadRaziei_liburlparser)
58
+ [![CodeFactor](https://www.codefactor.io/repository/github/mohammadraziei/liburlparser/badge/master)](https://www.codefactor.io/repository/github/mohammadraziei/liburlparser/overview/master)
57
59
  [![snyk.io](https://snyk.io/advisor/python/liburlparser/badge.svg)](https://snyk.io/advisor/python/liburlparser)
58
60
 
59
61
  [//]: # ([![View site - GH Pages]&#40;https://img.shields.io/badge/View_site-GH_Pages-2ea44f?style=for-the-badge&#41;]&#40;https://mohammadraziei.github.io/liburlparser/&#41;)
@@ -202,7 +204,7 @@ Host.extract_from_url("https://ee.aut.ac.ir/about") # from url
202
204
  there is some examples in [examples](https://github.com/MohammadRaziei/liburlparser/tree/master/examples) folder
203
205
 
204
206
  ```c++
205
- #include "liburlparser"
207
+ #include "urlparser.h"
206
208
  ...
207
209
  /// for parsing url
208
210
  TLD::Url url("https://ee.aut.ac.ir/about");
@@ -302,6 +304,9 @@ The test was conducted on a file containing 1 million random urls (Mar. 13rd 202
302
304
  Distributed under the MIT License. See [LICENSE](LICENSE) for more information.
303
305
 
304
306
 
307
+ ## Stats
308
+ [![Stars](https://starchart.cc/mohammadraziei/liburlparser.svg?variant=adaptive)](https://starchart.cc/mohammadraziei/liburlparser)
309
+
305
310
  ## Contact
306
311
 
307
312
  <!-- Gal Ben David - gal@intsights.com -->
@@ -27,6 +27,7 @@
27
27
  [![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-white.svg)](https://sonarcloud.io/summary/new_code?id=MohammadRaziei_liburlparser)
28
28
 
29
29
  [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=MohammadRaziei_liburlparser&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=MohammadRaziei_liburlparser)
30
+ [![CodeFactor](https://www.codefactor.io/repository/github/mohammadraziei/liburlparser/badge/master)](https://www.codefactor.io/repository/github/mohammadraziei/liburlparser/overview/master)
30
31
  [![snyk.io](https://snyk.io/advisor/python/liburlparser/badge.svg)](https://snyk.io/advisor/python/liburlparser)
31
32
 
32
33
  [//]: # ([![View site - GH Pages]&#40;https://img.shields.io/badge/View_site-GH_Pages-2ea44f?style=for-the-badge&#41;]&#40;https://mohammadraziei.github.io/liburlparser/&#41;)
@@ -175,7 +176,7 @@ Host.extract_from_url("https://ee.aut.ac.ir/about") # from url
175
176
  there is some examples in [examples](https://github.com/MohammadRaziei/liburlparser/tree/master/examples) folder
176
177
 
177
178
  ```c++
178
- #include "liburlparser"
179
+ #include "urlparser.h"
179
180
  ...
180
181
  /// for parsing url
181
182
  TLD::Url url("https://ee.aut.ac.ir/about");
@@ -275,6 +276,9 @@ The test was conducted on a file containing 1 million random urls (Mar. 13rd 202
275
276
  Distributed under the MIT License. See [LICENSE](LICENSE) for more information.
276
277
 
277
278
 
279
+ ## Stats
280
+ [![Stars](https://starchart.cc/mohammadraziei/liburlparser.svg?variant=adaptive)](https://starchart.cc/mohammadraziei/liburlparser)
281
+
278
282
  ## Contact
279
283
 
280
284
  <!-- Gal Ben David - gal@intsights.com -->
@@ -0,0 +1,63 @@
1
+ # Doxyfile.in
2
+
3
+ # Project information
4
+ PROJECT_NAME = @PROJECT_NAME@
5
+ PROJECT_VERSION = @PyProject_VERSION@
6
+ OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@
7
+ GENERATE_HTML = YES
8
+ GENERATE_LATEX = NO
9
+
10
+ # Source code
11
+ INPUT = @PROJECT_SOURCE_DIR@/include/urlparser.h @PROJECT_SOURCE_DIR@/include @PROJECT_SOURCE_DIR@/docs/cpp/mainpage.md @PROJECT_SOURCE_DIR@/docs/cpp/images
12
+ FILE_PATTERNS = *.cpp *.h *.hpp *.md *.svg
13
+ RECURSIVE = YES
14
+ EXCLUDE_PATTERNS = */tests*/* */build/* */dist/*
15
+
16
+ # Documentation settings
17
+ EXTRACT_ALL = YES
18
+ EXTRACT_PRIVATE = NO
19
+ EXTRACT_PACKAGE = YES
20
+ EXTRACT_STATIC = YES
21
+ EXTRACT_LOCAL_CLASSES = YES
22
+ HIDE_UNDOC_MEMBERS = NO
23
+ HIDE_UNDOC_CLASSES = NO
24
+ HIDE_SCOPE_NAMES = NO
25
+ SHOW_INCLUDE_FILES = YES
26
+ SHOW_GROUPED_MEMB_INC = YES
27
+ SORT_MEMBER_DOCS = YES
28
+ SORT_BRIEF_DOCS = YES
29
+ SORT_MEMBERS_CTORS_1ST = YES
30
+ SORT_GROUP_NAMES = YES
31
+
32
+ # Diagrams and graphs
33
+ HAVE_DOT = YES
34
+ UML_LOOK = YES
35
+ CALL_GRAPH = YES
36
+ CALLER_GRAPH = YES
37
+ DOT_IMAGE_FORMAT = SVG
38
+ INTERACTIVE_SVG = YES
39
+
40
+ # HTML output
41
+ HTML_DYNAMIC_SECTIONS = YES
42
+ HTML_TIMESTAMP = YES
43
+ SEARCHENGINE = YES
44
+ GENERATE_TREEVIEW = YES
45
+ DISABLE_INDEX = NO
46
+ FULL_SIDEBAR = NO
47
+ HTML_COLORSTYLE = LIGHT # required with Doxygen >= 1.9.5
48
+
49
+ USE_MDFILE_AS_MAINPAGE = @PROJECT_SOURCE_DIR@/docs/cpp/mainpage.md
50
+
51
+ # Image handling
52
+ IMAGE_PATH = @PROJECT_SOURCE_DIR@/docs/cpp/images
53
+
54
+ # HTML styling with awesome-css
55
+ HTML_EXTRA_STYLESHEET = @PROJECT_SOURCE_DIR@/third_party/doxygen-awesome-css/doxygen-awesome.css
56
+ HTML_EXTRA_FILES = @PROJECT_SOURCE_DIR@/third_party/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js \
57
+ @PROJECT_SOURCE_DIR@/third_party/doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js \
58
+ @PROJECT_SOURCE_DIR@/third_party/doxygen-awesome-css/doxygen-awesome-paragraph-link.js \
59
+ @PROJECT_SOURCE_DIR@/third_party/doxygen-awesome-css/doxygen-awesome-interactive-toc.js
60
+
61
+ HTML_HEADER = @PROJECT_SOURCE_DIR@/docs/cpp/header.html
62
+
63
+ # End of Doxyfile.in