Skip to content

Commit

Permalink
Merge pull request #85 from ethyca/discreet-api-sdk-packages
Browse files Browse the repository at this point in the history
Install the `api` and `sdk` packages independently
  • Loading branch information
PSalant726 authored Oct 26, 2022
2 parents d9b609c + bf6545b commit cfa6e85
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 148 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ jobs:
needs: Build
runs-on: ubuntu-latest
steps:
- name: Download fidescls container
- name: Download fideslog container
uses: actions/download-artifact@v2
with:
name: ${{ env.CONTAINER }}
path: /tmp/

- name: Load fidescls image
- name: Load fideslog image
run: docker load --input /tmp/${{ env.CONTAINER }}.tar

- name: Checkout
Expand All @@ -142,13 +142,13 @@ jobs:
SNOWFLAKE_DB_PASSWORD: ${{ secrets.SNOWFLAKE_DB_PASSWORD }}
SNOWFLAKE_DB_USER: ${{ secrets.SNOWFLAKE_DB_USER }}
steps:
- name: Download fidescls container
- name: Download fideslog container
uses: actions/download-artifact@v2
with:
name: ${{ env.CONTAINER }}
path: /tmp/

- name: Load fidescls image
- name: Load fideslog image
run: docker load --input /tmp/${{ env.CONTAINER }}.tar

- name: Checkout
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM python:3.9-slim-bullseye

# Required tools
RUN apt-get update
RUN apt-get install -y curl g++ gcc
RUN : \
&& apt-get update \
&& apt-get install -y \
curl \
g++ \
gcc

# Update pip and install requirements
RUN pip install -U pip
Expand Down
5 changes: 2 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
graft fideslog/sdk/python
include dev-requirements.txt
include fideslog/sdk/python/_version.py
include fideslog/sdk/python/README.md
include fideslog/sdk/python/requirements.txt
include versioneer.py
prune fideslog/api
22 changes: 11 additions & 11 deletions fideslog/sdk/python/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
# directories (produced by setup.py build) will contain a much shorter file
# that just contains the computed version number.

# This file is released into the public domain. Generated by
# versioneer-0.22 (https://github.com/python-versioneer/python-versioneer)
# This file is released into the public domain.
# Generated by versioneer-0.27
# https://github.com/python-versioneer/python-versioneer

"""Git implementation of _version.py."""

Expand Down Expand Up @@ -250,19 +251,18 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command):
runner = functools.partial(runner, env=env)

_, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root,
hide_stderr=True)
hide_stderr=not verbose)
if rc != 0:
if verbose:
print("Directory %s not under git control" % root)
raise NotThisMethod("'git rev-parse --git-dir' returned error")

MATCH_ARGS = ["--match", "%s*" % tag_prefix] if tag_prefix else []

# if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
# if there isn't one, this yields HEX[-dirty] (no NUM)
describe_out, rc = runner(GITS, ["describe", "--tags", "--dirty",
"--always", "--long", *MATCH_ARGS],
cwd=root)
describe_out, rc = runner(GITS, [
"describe", "--tags", "--dirty", "--always", "--long",
"--match", f"{tag_prefix}[[:digit:]]*"
], cwd=root)
# --long was added in git-1.5.5
if describe_out is None:
raise NotThisMethod("'git describe' failed")
Expand Down Expand Up @@ -351,8 +351,8 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command):
else:
# HEX: no tags
pieces["closest-tag"] = None
count_out, rc = runner(GITS, ["rev-list", "HEAD", "--count"], cwd=root)
pieces["distance"] = int(count_out) # total number of commits
out, rc = runner(GITS, ["rev-list", "HEAD", "--left-right"], cwd=root)
pieces["distance"] = len(out.split()) # total number of commits

# commit date: see ISO-8601 comment in git_versions_from_keywords()
date = runner(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip()
Expand Down Expand Up @@ -448,7 +448,7 @@ def render_pep440_pre(pieces):
tag_version, post_version = pep440_split_post(pieces["closest-tag"])
rendered = tag_version
if post_version is not None:
rendered += ".post%d.dev%d" % (post_version+1, pieces["distance"])
rendered += ".post%d.dev%d" % (post_version + 1, pieces["distance"])
else:
rendered += ".post0.dev%d" % (pieces["distance"])
else:
Expand Down
2 changes: 1 addition & 1 deletion fideslog/sdk/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ aiohttp[speedups]==3.8.1
bcrypt~=3.2.0
types-requests==2.27.11
validators==0.20.0
versioneer>=0.19
versioneer==0.27
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ VCS = git
style = pep440
versionfile_source = fideslog/sdk/python/_version.py
versionfile_build = fideslog/sdk/python/_version.py
tag_prefix =
tag_prefix = v
parentdir_prefix =
35 changes: 17 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
import pathlib

from setuptools import setup

import versioneer

here = pathlib.Path(__file__).parent.resolve()
long_description = open("./fideslog/sdk/python/README.md").read()
from versioneer import get_cmdclass, get_version

# Requirements
install_requires = (
open("fideslog/sdk/python/requirements.txt").read().strip().split("\n")
)
dev_requires = open("dev-requirements.txt").read().strip().split("\n")
api_requires = open("./fideslog/api/requirements.txt").read().strip().split("\n")
sdk_requires = open("./fideslog/sdk/python/requirements.txt").read().strip().split("\n")
dev_requires = open("./dev-requirements.txt").read().strip().split("\n")

setup(
name="fideslog",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description="SDK for interacting with fideslog",
long_description=long_description,
version=get_version(),
cmdclass=get_cmdclass(),
description="The fideslog analytics collection mechanism",
long_description=open("./README.md").read(),
long_description_content_type="text/markdown",
url="https://github.com/ethyca/fideslog",
python_requires=">=3.8, <4",
package_dir={"fideslog": "fideslog"},
packages=["fideslog.sdk.python"],
package_dir={
"fideslog.api": "fideslog/api",
"fideslog.sdk.python": "fideslog/sdk/python",
},
packages=[
"fideslog.api",
"fideslog.sdk.python",
],
author="Ethyca, Inc.",
author_email="fidesteam@ethyca.com",
license="Apache License 2.0",
install_requires=install_requires,
install_requires=api_requires + sdk_requires,
dev_requires=dev_requires,
classifiers=[
"License :: OSI Approved :: Apache Software License",
Expand Down
Loading

0 comments on commit cfa6e85

Please sign in to comment.