diff --git a/requirements-test.txt b/requirements-test.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f3c7e8e6ffb905f7de8b597eb22213a7dc20bfb3
--- /dev/null
+++ b/requirements-test.txt
@@ -0,0 +1 @@
+nose
diff --git a/setup.py b/setup.py
index 7e4a47ceb5549af703f343344c5e3161177d948b..ecff0dc62e864399ebb00eb11da74666de90403b 100644
--- a/setup.py
+++ b/setup.py
@@ -1,17 +1,25 @@
 import hashlib
+import os
 
 from setuptools import setup, find_packages
 
 
-def parse_requirements():
+def parse_requirements(name=None):
+    if name:
+        reqf = 'requirements-%s.txt' % name
+    else:
+        reqf = 'requirements.txt'
+
     requirements = []
-    for reqf in ('requirements.txt', 'requirements-swh.txt'):
-        with open(reqf) as f:
-            for line in f.readlines():
-                line = line.strip()
-                if not line or line.startswith('#'):
-                    continue
-                requirements.append(line)
+    if not os.path.exists(reqf):
+        return requirements
+
+    with open(reqf) as f:
+        for line in f.readlines():
+            line = line.strip()
+            if not line or line.startswith('#'):
+                continue
+            requirements.append(line)
     return requirements
 
 
@@ -42,12 +50,14 @@ setup(
     url='https://forge.softwareheritage.org/diffusion/DMOD/',
     packages=find_packages(),  # packages's modules
     scripts=[],   # scripts to package
-    install_requires=parse_requirements() + extra_requirements,
+    install_requires=(parse_requirements() + parse_requirements('swh') +
+                      extra_requirements),
     entry_points='''
         [console_scripts]
         swh-identify=swh.model.cli:identify
     ''',
     setup_requires=['vcversioner'],
+    extras_require={'testing': parse_requirements('test')},
     vcversioner={},
     include_package_data=True,
 )