Skip to content

Commit

Permalink
moved from poetry to regular setup.py
Browse files Browse the repository at this point in the history
* added first github action

* moved from poetry to regular setup.py

* updated workflows

* added workflow_dispatch

* next try

* next try
  • Loading branch information
birnbaum authored May 25, 2021
1 parent fc4406f commit 77294ed
Show file tree
Hide file tree
Showing 32 changed files with 125 additions and 62 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Main

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7] # , 3.8, 3.9

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
- name: Run simple example
run: python examples/simple/main.py
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish new release on PyPI

on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Build
run: python setup.py sdist
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Project
**/results/**/*.csv

# Poetry
poetry.lock

# IDE
.idea

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import networkx as nx
import simpy

from leaf.examples.smart_city_traffic.infrastructure import Cloud, FogNode, TrafficLight, LinkWanUp, LinkEthernet, \
from examples.smart_city_traffic.infrastructure import Cloud, FogNode, TrafficLight, LinkWanUp, LinkEthernet, \
LinkWifiBetweenTrafficLights, LinkWanDown, LinkWifiTaxiToTrafficLight, Taxi
from leaf.examples.smart_city_traffic.mobility import Location
from leaf.examples.smart_city_traffic.orchestrator import CityOrchestrator
from leaf.examples.smart_city_traffic.settings import *
from examples.smart_city_traffic.mobility import Location
from examples.smart_city_traffic.orchestrator import CityOrchestrator
from examples.smart_city_traffic.settings import *
from leaf.infrastructure import Infrastructure


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import simpy

from leaf.application import Application, SourceTask, ProcessingTask, SinkTask
from leaf.examples.smart_city_traffic.settings import *
from examples.smart_city_traffic.settings import *
from leaf.infrastructure import Link, Node
from leaf.power import PowerModelLink, PowerModelNode, PowerModelNodeShared, PowerMeasurement

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import simpy
from tqdm import tqdm

from leaf.examples.smart_city_traffic.city import City
from leaf.examples.smart_city_traffic.infrastructure import Cloud, FogNode, Taxi, LinkWanDown, LinkWanUp, \
from examples.smart_city_traffic.city import City
from examples.smart_city_traffic.infrastructure import Cloud, FogNode, Taxi, LinkWanDown, LinkWanUp, \
LinkWifiTaxiToTrafficLight, LinkWifiBetweenTrafficLights, TrafficLight
from leaf.examples.smart_city_traffic.mobility import MobilityManager
from leaf.examples.smart_city_traffic.settings import SIMULATION_TIME, FOG_DCS, POWER_MEASUREMENT_INTERVAL, \
from examples.smart_city_traffic.mobility import MobilityManager
from examples.smart_city_traffic.settings import SIMULATION_TIME, FOG_DCS, POWER_MEASUREMENT_INTERVAL, \
FOG_IDLE_SHUTDOWN
from leaf.infrastructure import Infrastructure
from leaf.power import PowerMeter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import networkx as nx
import simpy

from leaf.examples.smart_city_traffic.infrastructure import TrafficLight, Taxi
from leaf.examples.smart_city_traffic.settings import UPDATE_MOBILITY_INTERVAL, MAX_CARS_PER_MINUTE, RNG, \
from examples.smart_city_traffic.infrastructure import TrafficLight, Taxi
from examples.smart_city_traffic.settings import UPDATE_MOBILITY_INTERVAL, MAX_CARS_PER_MINUTE, RNG, \
TAXI_COUNT_DISTRIBUTION, TAXI_SPEED_DISTRIBUTION


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import math

from leaf.application import Application, ProcessingTask
from leaf.examples.smart_city_traffic.infrastructure import FogNode, Cloud
from leaf.examples.smart_city_traffic.settings import FOG_UTILIZATION_THRESHOLD, FOG_DCS, FOG_IDLE_SHUTDOWN
from examples.smart_city_traffic.infrastructure import FogNode, Cloud
from examples.smart_city_traffic.settings import FOG_UTILIZATION_THRESHOLD, FOG_DCS, FOG_IDLE_SHUTDOWN
from leaf.infrastructure import Infrastructure, Node
from leaf.orchestrator import Orchestrator

Expand Down
File renamed without changes.
46 changes: 0 additions & 46 deletions pyproject.toml

This file was deleted.

55 changes: 55 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import os
from setuptools import setup

here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
long_description = "\n" + f.read()

if __name__ == "__main__":
setup(
name='leafsim',
use_scm_version=True,
author="Philipp Wiesner",
author_email="[email protected]",
description="Simulator for modeling energy consumption in cloud, fog, and edge computing environments",
long_description=long_description,
keywords=["simulation", "modeling", "fog computing", "energy consumption", "edge computing"],
url="https://github.com/dos-group/leaf",
project_urls={
"Bug Tracker": "https://github.com/dos-group/leaf/issues",
"Documentation": "https://leaf.readthedocs.io/",
},
packages=["leaf"],
license="MIT",
python_requires=">=3.6",
setup_requires=['setuptools_scm'],
install_requires=[
'networkx~=2.5',
'numpy~=1.20',
'pandas~=1.2',
'simpy~=4.0',
'tqdm~=4.0',
],
extras_require={
"docs": ["sphinx", "alabaster"]
},
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Education",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Distributed Computing",
"Typing :: Typed",
],
)

0 comments on commit 77294ed

Please sign in to comment.