Skip to content

Commit

Permalink
fix: use tom to pass dependencies to setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
matfax committed Oct 17, 2019
1 parent 588ea30 commit ce33dba
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 129 deletions.
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ sphinx = "==2.2.0"
sphinx-rtd-theme = "==0.4.3"
sphinx-fakeinv = "==1.0.0"
m2r = "==0.2.1"
requirementslib = "==1.5.3"

[packages]
path-py = "==12.0.1"
Expand Down
124 changes: 1 addition & 123 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
14 changes: 9 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import os
from pathlib import Path

from requirementslib import Lockfile
import toml
from setuptools import setup, find_packages

lockfile = Lockfile.create(os.getcwd())

def get_dependencies():
with open('Pipfile', 'r') as fh:
pipfile = fh.read()
return toml.loads(pipfile).values()


setup(
name="mutapath",
Expand All @@ -18,8 +22,8 @@
author_email="matthias.fax@gmail.com",
url="https://github.com/matfax/mutapath",
keywords=["pathlib", "mutable", "path"],
setup_requires=["setuptools-git-version", "requirementslib"],
install_requires=lockfile.as_requirements(dev=False),
setup_requires=["setuptools-git-version"],
install_requires=get_dependencies(),
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
Expand Down

0 comments on commit ce33dba

Please sign in to comment.