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

Rewrite setup script to follow PEP 621 and PEP 440 #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This is loaded by setuptools to generate python package metadata

import subprocess
from time import time_ns
import re

def run(args) :
return subprocess.run(args, stdout=subprocess.PIPE).stdout.decode('utf-8')

# Get current git branch
curr_branch = run(["git", "branch", "--show-current"])

with open("VERSION", "r") as f:
VERSION = re.sub("\s+", "", f.read())
print(VERSION)

if curr_branch != "master" :
# Setup version name following PEP 440
VERSION += ".dev"+run(["git", "-P", "show", "--format=format:%at", "--no-patch"])

45 changes: 45 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "lca_algebraic"
dynamic = ["version"]
description = "This library provides a layer above brightway2 for defining parametric models and running super fast LCA for monte carlo analysis."
requires-python = ">= 3.7"
readme = {file = "README.md", content-type = "text/markdown"}
keywords = ["LCA", "brightway2", "monte-carlo", "parametric"]
authors = [
{name = "OIE - Mines ParisTech"},
{name = "Raphaël Jolivet", email = "[email protected]"}
]
maintainers = [
{name = "Raphaël Jolivet", email = "[email protected]"}
]
classifiers = [
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11"
]
dependencies = [
"tabulate",
"ipywidgets",
"pandas",
"seaborn",
"sympy",
"matplotlib",
"deprecation",
"brightway2==2.3",
"SALib"
]

[project.urls]
Homepage = "https://github.com/oie-mines-paristech/lca_algebraic/"
Repository = "https://github.com/oie-mines-paristech/lca_algebraic/"
Issues = "https://github.com/oie-mines-paristech/lca_algebraic/issues"

[tool.setuptools.dynamic]
version = {attr = "metadata.VERSION"}
62 changes: 0 additions & 62 deletions setup.py

This file was deleted.