Skip to content

Commit

Permalink
Merge pull request #1 from uliegecsm/make_package
Browse files Browse the repository at this point in the history
feature: Add setup.py to allow installation
  • Loading branch information
romintomasetti authored Jul 3, 2024
2 parents 896790d + fc9f3de commit e2560d4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,27 @@ jobs:

- name: Prepare.
run : |
pip install -r requirements.txt
pip install pytest
pip install -r requirements.txt
pip install pytest
- name: Run tests.
run : |
PYTHONPATH=$PWD pytest tests/test_topology.py
PYTHONPATH=$PWD pytest tests/test_topology.py
install-as-package:
runs-on: [ubuntu-latest]
container:
image: python:3.9
steps:
- name: Prepare.
run : |
apt update
apt --yes --no-install-recommends install hwloc
- name: Install as package.
run : |
pip3 install git+https://github.com/uliegecsm/hwloc-xml-parser.git@${{ github.sha }}
- name: Test package.
run : |
python3 -c "from hwloc_xml_parser.topology import SystemTopology; topo = SystemTopology()"
Empty file added hwloc_xml_parser/__init__.py
Empty file.
File renamed without changes.
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from setuptools import setup, find_packages

setup(
name = 'hwloc-xml-parser',
version = '0.1',
install_requires = [
'typeguard',
],
packages = find_packages(),
license = 'MIT',
url = 'https://github.com/uliegecsm/hwloc-xml-parser'
)
2 changes: 1 addition & 1 deletion tests/test_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import unittest
from unittest.mock import call

from topology import SystemTopology
from hwloc_xml_parser.topology import SystemTopology

class TestSystemTopology:
"""
Expand Down

0 comments on commit e2560d4

Please sign in to comment.