Skip to content

Commit

Permalink
feat: settings file - adding config os class
Browse files Browse the repository at this point in the history
  • Loading branch information
lpmatos committed Jul 27, 2020
1 parent 27e13b0 commit 4a471f9
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ WORKDIR /usr/src/code

COPY [ "./gitlab-clone", "." ]

RUN git config --global user.name "Lucca Pessoa" && \
git config --global user.email "luccapsm@gmail.com" && \
RUN git config --global user.name "root" && \
git config --global user.email "root@root.com" && \
git config --global credential.helper cache

RUN find ./ -iname "*.py" -type f -exec chmod a+x {} \; -exec echo {} \;;
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ cz-cli@4.0.3, cz-conventional-changelog@3.2.0
revert: Reverts a previous commit
```

### Python Package

```bash
python3 setup.py register sdist upload
```

### How to contribute

>
Expand Down
3 changes: 3 additions & 0 deletions cloner/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

__version__ = "0.0.2"
6 changes: 4 additions & 2 deletions gitlab/cli.py → cloner/cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-

import os
import sys
import re
Expand All @@ -6,10 +8,10 @@
import gitlab
import optparse
import subprocess
from settings import Config

def pname():
pid = os.getpid()
return f"[gitlab-cloner - {str(pid)}]"
return f"[gitlab-cloner - {str(os.getpid())}]"

def main():
parser = optparse.OptionParser("usage: %prog [options]")
Expand Down
14 changes: 14 additions & 0 deletions cloner/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-

from os import environ
from typing import Text

class Config:

@staticmethod
def get_env(env: Text) -> Text:
try:
return environ.get(env)
except KeyError as error:
print(f"Key Error: {error}")

1 change: 0 additions & 1 deletion gitlab/__init__.py

This file was deleted.

34 changes: 18 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,30 @@

"""The setup script."""

from cloner import __version__
from setuptools import setup, find_packages

requirements = ['requests']

setup(
author="Lucca Pessoa da Silva Matos",
author_email='luccapsm@gmail.com',
description="Gitlab tool for recursive clone",
install_requires=requirements,
license="MIT license",
include_package_data=True,
keywords=[
'gitlab', 'gitlab-api',
author = "Lucca Pessoa da Silva Matos",
author_email = "luccapsm@gmail.com",
description = "Gitlab tool for recursive clone",
install_requires = requirements,
license = "MIT license",
include_package_data = True,
keywords = [
"gitlab",
"gitlab-api",
],
name='gitlab-clone-recursive',
packages=find_packages(include=['gitlab']),
url='https://github.com/lpmatos/gitlab-clone-recursive',
version='0.0.2',
entry_points={
"console_scripts": [
"gitlab-clone-recursive=gitlab.cli:main",
name = "gitlab-cr",
packages = find_packages(include=["cloner"]),
url = "https://github.com/lpmatos/gitlab-clone-recursive",
version = __version__,
entry_points = {
"console_scripts" : [
"gitlab-cr=cloner.cli:main",
]
},
zip_safe=False,
zip_safe = False,
)

0 comments on commit 4a471f9

Please sign in to comment.