From 26db6a5d644645e637c0dd02788f21e769adfb42 Mon Sep 17 00:00:00 2001
From: Maja Jablonska <majajjablonska@gmail.com>
Date: Sun, 1 Oct 2023 23:45:08 +1100
Subject: [PATCH] Add setup.py

---
 .idea/combolightning.iml        |  4 +++-
 combo/config/from_parameters.py |  7 ------
 combo/main.py                   |  1 +
 setup.py                        | 38 +++++++++++++++++++++++++++++++++
 4 files changed, 42 insertions(+), 8 deletions(-)
 mode change 100644 => 100755 combo/main.py
 create mode 100644 setup.py

diff --git a/.idea/combolightning.iml b/.idea/combolightning.iml
index d4c73d1..3578d35 100644
--- a/.idea/combolightning.iml
+++ b/.idea/combolightning.iml
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module type="PYTHON_MODULE" version="4">
   <component name="NewModuleRootManager">
-    <content url="file://$MODULE_DIR$" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/combo" isTestSource="false" />
+    </content>
     <orderEntry type="jdk" jdkName="combo" jdkType="Python SDK" />
     <orderEntry type="sourceFolder" forTests="false" />
   </component>
diff --git a/combo/config/from_parameters.py b/combo/config/from_parameters.py
index 7d7d507..0e1f185 100644
--- a/combo/config/from_parameters.py
+++ b/combo/config/from_parameters.py
@@ -8,7 +8,6 @@ import torch
 from combo.common.params import Params
 from combo.config.exceptions import RegistryException
 from combo.config.registry import (Registry)
-from combo.nn import Activation
 from combo.utils import ConfigurationError
 
 
@@ -51,12 +50,6 @@ def _resolve(type: Type[object],
                 return _resolve(type.__base__, values, pass_to_subclasses, default_name)
             warnings.warn(f'No classes of type {type} (values: {values}) in Registry!')
             return values
-    elif type is Activation and isinstance(values, str):
-        try:
-            return Registry.resolve(type, values)()
-        except RegistryException:
-            warnings.warn(f'No Activation of class name {values} in Registry!')
-            return values
     else:
         return values
 
diff --git a/combo/main.py b/combo/main.py
old mode 100644
new mode 100755
index 207b9fd..d12b5f4
--- a/combo/main.py
+++ b/combo/main.py
@@ -82,6 +82,7 @@ flags.DEFINE_enum(name="predictor_name", default="combo-spacy",
 
 
 def run(_):
+    print("COMBO")
     pass
 
 
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..d5bdfd3
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,38 @@
+import subprocess
+from setuptools import find_packages, setup
+
+subprocess.call(['pip', 'install', '--no-deps', 'git+https://gitlab.clarin-pl.eu/syntactic-tools/lambo.git#egg=lambo'])
+
+REQUIREMENTS = [
+    "absl-py~=1.4.0",
+    "base58~=2.1.1",
+    "cached-path~=1.3.3",
+    "conllu~=4.4.1",
+    "conllutils~=1.1.4",
+    "dill~=0.3.6",
+    "importlib-resources~=5.12.0",
+    "overrides~=7.3.1",
+    "torch~=2.0.0",
+    "torchtext~=0.15.1",
+    "numpy~=1.24.1",
+    "pytorch-lightning~=2.0.01",
+    "requests~=2.28.2",
+    "tqdm~=4.64.1",
+    "urllib3~=1.26.14",
+    "filelock~=3.9.0",
+    "pytest~=7.2.2",
+    "transformers~=4.27.3",
+    "spacy~=3.3.1"
+]
+
+setup(
+    name="combo",
+    version="2.0.0",
+    author="Maja Jablonska",
+    author_email="maja.jablonska@ipipan.waw.pl",
+    install_requirements=REQUIREMENTS,
+    packages=find_packages(exclude=['tests']),
+    license="GPL-3.0",
+    keywords="nlp natural-language-processing dependency-parsing",
+    entrypoints={'console_scripts': ['combo = combo.main:main']}
+)
\ No newline at end of file
-- 
GitLab