bigrandomgraphs 0.0.4__tar.gz → 0.1.0__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.
@@ -0,0 +1,95 @@
1
+ name: Build wheels
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+ release:
7
+ types: [ published ] # triggers PyPI (when you manually publish a Release on GitHub)
8
+ pull_request:
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ build_wheels:
13
+ name: Wheels on ${{ matrix.os }}
14
+ runs-on: ${{ matrix.os }}
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ os: [ubuntu-latest, macos-latest, windows-latest]
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - name: Build wheels
23
+ uses: pypa/cibuildwheel@v2.22.0
24
+
25
+ - uses: actions/upload-artifact@v4
26
+ with:
27
+ name: wheels-${{ matrix.os }}
28
+ path: ./wheelhouse/*.whl
29
+
30
+ build_sdist:
31
+ name: Build sdist
32
+ runs-on: ubuntu-latest
33
+ steps:
34
+ - uses: actions/checkout@v4
35
+
36
+ - name: Build sdist
37
+ run: pipx run build --sdist
38
+
39
+ - uses: actions/upload-artifact@v4
40
+ with:
41
+ name: sdist
42
+ path: dist/*.tar.gz
43
+
44
+ publish-to-testpypi:
45
+ name: Publish Python 🐍 distribution 📦 to TestPyPI
46
+ needs:
47
+ - build_sdist
48
+ - build_wheels
49
+ runs-on: ubuntu-latest
50
+
51
+ environment:
52
+ name: testpypi
53
+ url: https://test.pypi.org/p/bigrandomgraphs
54
+
55
+ permissions:
56
+ id-token: write # IMPORTANT: mandatory for trusted publishing
57
+
58
+ steps:
59
+ - name: Download all the dists
60
+ uses: actions/download-artifact@v4
61
+ with:
62
+ merge-multiple: true
63
+ path: dist/
64
+ - name: Publish distribution 📦 to TestPyPI
65
+ uses: pypa/gh-action-pypi-publish@release/v1
66
+ with:
67
+ skip-existing: true
68
+ verbose: true
69
+ repository-url: https://test.pypi.org/legacy/
70
+
71
+ publish-to-pypi:
72
+ name: >-
73
+ Publish Python 🐍 distribution 📦 to PyPI
74
+ if: github.event_name == 'release' && github.event.action == 'published' # only publish to PyPI on tag pushes
75
+ needs:
76
+ - build_sdist
77
+ - build_wheels
78
+ runs-on: ubuntu-latest
79
+ environment:
80
+ name: pypi
81
+ url: https://pypi.org/p/bigrandomgraphs
82
+ permissions:
83
+ id-token: write # IMPORTANT: mandatory for trusted publishing
84
+
85
+ steps:
86
+ - name: Download all the dists
87
+ uses: actions/download-artifact@v4
88
+ with:
89
+ merge-multiple: true
90
+ path: dist/
91
+ - name: Publish distribution 📦 to PyPI
92
+ uses: pypa/gh-action-pypi-publish@release/v1
93
+ with:
94
+ skip-existing: true
95
+ verbose: true
@@ -0,0 +1,23 @@
1
+ # Build / packaging outputs
2
+ build/
3
+ dist/
4
+ wheelhouse/
5
+ *.egg-info/
6
+
7
+ # Compiled extension from in-place builds
8
+ *.so
9
+
10
+ # Python bytecode
11
+ __pycache__/
12
+ *.py[cod]
13
+
14
+ # Virtual environments
15
+ .venv/
16
+ venv/
17
+
18
+ # IDE
19
+ .idea/
20
+ .vscode/
21
+
22
+ # macOS
23
+ .DS_Store
@@ -0,0 +1,8 @@
1
+ cmake_minimum_required(VERSION 3.15)
2
+ project(pybrg LANGUAGES CXX)
3
+
4
+ find_package(pybind11 CONFIG REQUIRED)
5
+
6
+ pybind11_add_module(pybrg src/wrapper_bindings.cpp)
7
+
8
+ install(TARGETS pybrg DESTINATION .)
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Jason Smith
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,63 @@
1
+ Metadata-Version: 2.1
2
+ Name: bigrandomgraphs
3
+ Version: 0.1.0
4
+ Summary: Python package for fast creation of large random graphs
5
+ Author: Jason P. Smith
6
+ License: MIT License
7
+
8
+ Copyright (c) 2024 Jason Smith
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Requires-Python: >=3.9
29
+ Requires-Dist: numpy
30
+ Provides-Extra: test
31
+ Requires-Dist: pytest; extra == "test"
32
+ Description-Content-Type: text/markdown
33
+
34
+ # bigrandomgraphs
35
+
36
+ Fast, parallel generation of large sparse random graphs in C++ with a Python interface.
37
+
38
+ ## Install
39
+
40
+ ```bash
41
+ pip install bigrandomgraphs # from PyPI (once published)
42
+ pip install . # from a local checkout
43
+ pip install git+https://github.com/<user>/bigrandomgraphs.git
44
+ ```
45
+
46
+ Python ≥ 3.9. Source installs need a C++ compiler; CMake ≥ 3.15 is fetched automatically by the build frontend if not already present. Pre-built wheels are produced by CI for Linux x86_64, macOS arm64, macOS x86_64, and Windows x64 across CPython 3.9–3.13.
47
+
48
+ ## Testing
49
+
50
+ ```bash
51
+ pip install -e .[test]
52
+ python -m pytest
53
+ ```
54
+
55
+ Use `python -m pytest` rather than bare `pytest` — the latter resolves via `$PATH` and can end up in a Python environment that doesn't have `bigrandomgraphs` installed, producing a confusing `ModuleNotFoundError: No module named 'pybrg'` at collection time.
56
+
57
+ ## TODO
58
+
59
+ * [ ] Add "Publish to PyPI" in github workflows
60
+
61
+ ## License
62
+
63
+ See [LICENSE](LICENSE).
@@ -0,0 +1,30 @@
1
+ # bigrandomgraphs
2
+
3
+ Fast, parallel generation of large sparse random graphs in C++ with a Python interface.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pip install bigrandomgraphs # from PyPI (once published)
9
+ pip install . # from a local checkout
10
+ pip install git+https://github.com/<user>/bigrandomgraphs.git
11
+ ```
12
+
13
+ Python ≥ 3.9. Source installs need a C++ compiler; CMake ≥ 3.15 is fetched automatically by the build frontend if not already present. Pre-built wheels are produced by CI for Linux x86_64, macOS arm64, macOS x86_64, and Windows x64 across CPython 3.9–3.13.
14
+
15
+ ## Testing
16
+
17
+ ```bash
18
+ pip install -e .[test]
19
+ python -m pytest
20
+ ```
21
+
22
+ Use `python -m pytest` rather than bare `pytest` — the latter resolves via `$PATH` and can end up in a Python environment that doesn't have `bigrandomgraphs` installed, producing a confusing `ModuleNotFoundError: No module named 'pybrg'` at collection time.
23
+
24
+ ## TODO
25
+
26
+ * [ ] Add "Publish to PyPI" in github workflows
27
+
28
+ ## License
29
+
30
+ See [LICENSE](LICENSE).
@@ -0,0 +1,35 @@
1
+ [build-system]
2
+ requires = ["scikit-build-core>=0.10", "pybind11>=2.12"]
3
+ build-backend = "scikit_build_core.build"
4
+
5
+ [project]
6
+ name = "bigrandomgraphs"
7
+ version = "0.1.0"
8
+ description = "Python package for fast creation of large random graphs"
9
+ readme = "README.md"
10
+ license = { file = "LICENSE" }
11
+ authors = [{ name = "Jason P. Smith" }]
12
+ requires-python = ">=3.9"
13
+
14
+ dependencies = [
15
+ "numpy",
16
+ ]
17
+
18
+ [project.optional-dependencies]
19
+ test = ["pytest"]
20
+
21
+ [tool.pytest.ini_options]
22
+ python_files = ["test.py", "test_*.py"]
23
+
24
+ [tool.scikit-build]
25
+ minimum-version = "0.10"
26
+ cmake.version = ">=3.15"
27
+ wheel.packages = ["bigrandomgraphs"]
28
+
29
+ [tool.cibuildwheel]
30
+ build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"]
31
+ skip = ["*-musllinux_*", "*_i686"]
32
+ test-command = 'python -c "import pybrg"'
33
+
34
+ [tool.cibuildwheel.macos]
35
+ archs = ["x86_64", "arm64"]
@@ -1,4 +0,0 @@
1
- cmake_minimum_required(VERSION 2.8.12)
2
- project(pybrg)
3
- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/pybind11)
4
- pybind11_add_module(pybrg ./src/wrapper_bindings.cpp)
@@ -1,5 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: bigrandomgraphs
3
- Version: 0.0.4
4
- Summary: Python package for fast creation of large random graphs
5
- Author: Jason P. Smith
@@ -1,2 +0,0 @@
1
- # bigrandomgraphs
2
- Python package for fast creation of large random graphs
@@ -1,5 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: bigrandomgraphs
3
- Version: 0.0.4
4
- Summary: Python package for fast creation of large random graphs
5
- Author: Jason P. Smith
@@ -1,13 +0,0 @@
1
- CMakeLists.txt
2
- README.md
3
- setup.py
4
- test.py
5
- ./src/__init__.py
6
- bigrandomgraphs.egg-info/PKG-INFO
7
- bigrandomgraphs.egg-info/SOURCES.txt
8
- bigrandomgraphs.egg-info/dependency_links.txt
9
- bigrandomgraphs.egg-info/not-zip-safe
10
- bigrandomgraphs.egg-info/top_level.txt
11
- src/__init__.py
12
- src/generate_model.cpp
13
- src/wrapper_bindings.cpp
@@ -1 +0,0 @@
1
- bigrandomgraphs
@@ -1,4 +0,0 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
@@ -1,89 +0,0 @@
1
- import os
2
- import re
3
- import sys
4
- import platform
5
- import subprocess
6
-
7
- from setuptools import setup, Extension, find_packages
8
- from setuptools.command.build_ext import build_ext
9
- from distutils.version import LooseVersion
10
-
11
-
12
- class CMakeExtension(Extension):
13
- def __init__(self, name, sourcedir=''):
14
- Extension.__init__(self, name, sources=[])
15
- self.sourcedir = os.path.abspath(sourcedir)
16
-
17
-
18
- class CMakeBuild(build_ext):
19
- def run(self):
20
- try:
21
- out = subprocess.check_output(['cmake', '--version'])
22
- except OSError:
23
- raise RuntimeError("CMake must be installed to build the following extensions: " +
24
- ", ".join(e.name for e in self.extensions))
25
-
26
- if platform.system() == "Windows":
27
- cmake_version = LooseVersion(re.search(r'version\s*([\d.]+)', out.decode()).group(1))
28
- if cmake_version < '3.1.0':
29
- raise RuntimeError("CMake >= 3.1.0 is required on Windows")
30
-
31
- self.install_dependencies()
32
-
33
- for ext in self.extensions:
34
- self.build_extension(ext)
35
-
36
- def install_dependencies(self):
37
- dir_start = os.getcwd()
38
- dir_pybind11 = os.path.join(dir_start, 'pybind11')
39
- if os.path.exists(dir_pybind11):
40
- return 0
41
- os.mkdir(dir_pybind11)
42
- subprocess.check_call(['git', 'clone',
43
- 'https://github.com/pybind/pybind11.git',
44
- dir_pybind11])
45
- #subprocess.check_call(['git', 'checkout', '0bd8896'])#v 2.10.3
46
-
47
- # subprocess.check_call(['git', 'submodule', 'update',
48
- # '--init', '--recursive'])
49
-
50
- def build_extension(self, ext):
51
- extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name)))
52
- # required for auto-detection of auxiliary "native" libs
53
- if not extdir.endswith(os.path.sep):
54
- extdir += os.path.sep
55
-
56
- cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
57
- '-DPYTHON_EXECUTABLE=' + sys.executable]
58
-
59
- cfg = 'Debug' if self.debug else 'Release'
60
- build_args = ['--config', cfg]
61
-
62
- if platform.system() == "Windows":
63
- cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)]
64
- if sys.maxsize > 2**32:
65
- cmake_args += ['-A', 'x64']
66
- build_args += ['--', '/m']
67
- else:
68
- cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]
69
- build_args += ['--', '-j2']
70
-
71
- env = os.environ.copy()
72
- env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''),
73
- self.distribution.get_version())
74
- if not os.path.exists(self.build_temp):
75
- os.makedirs(self.build_temp)
76
- subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
77
- subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
78
-
79
- setup(
80
- name='bigrandomgraphs',
81
- version='0.0.4',
82
- author='Jason P. Smith',
83
- description='Python package for fast creation of large random graphs',
84
- ext_modules=[CMakeExtension('bigrandomgraphs')],
85
- cmdclass=dict(build_ext=CMakeBuild),
86
- packages=['bigrandomgraphs'],
87
- package_dir={'bigrandomgraphs': './src/'},
88
- zip_safe=False,
89
- )
File without changes