diff --git a/src/catkin_pkg/package.py b/src/catkin_pkg/package.py
index f7e0717..0cfce13 100644
--- a/src/catkin_pkg/package.py
+++ b/src/catkin_pkg/package.py
@@ -262,6 +262,9 @@ class Dependency(object):
             return False
         return all([getattr(self, attr) == getattr(other, attr) for attr in self.__slots__])
 
+    def __hash__(self):
+        return hash(tuple([getattr(self, slot) for slot in self.__slots__]))
+
     def __str__(self):
         return self.name
 

Dependency should have a hash function
Although they are not immutable, this is important for being able to deduplicate/manage them using `set()`. I'm monkey-patching in this one, but it'd be great to have it merge upstream:

```
import catkin_pkg.package
catkin_pkg.package.Dependency.__hash__ = lambda self: hash(tuple([getattr(self, slot) for slot in self.__slots__]))
```
diff --git a/test/test_package.py b/test/test_package.py
index 527f5b0..850d515 100644
--- a/test/test_package.py
+++ b/test/test_package.py
@@ -59,6 +59,26 @@ class PackageTest(unittest.TestCase):
         self.assertEquals(5, dep.version_gt)
         self.assertRaises(TypeError, Dependency, 'foo', unknownattribute=42)
 
+        d = {}
+        d[dep] = None
+        dep2 = Dependency('foo',
+                          version_lt=1,
+                          version_lte=2,
+                          version_eq=3,
+                          version_gte=4,
+                          version_gt=5)
+        d[dep2] = None
+        self.assertEquals(len(d), 1)
+        dep3 = Dependency('foo',
+                          version_lt=1,
+                          version_lte=2,
+                          version_eq=3,
+                          version_gte=4,
+                          version_gt=6)
+        d[dep3] = None
+        self.assertEquals(len(d), 2)
+
+
     def test_init_kwargs_string(self):
         pack = Package('foo',
                        name='bar',

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest mock nose
apt-get update apt-get install -y gcc
3.9
requirements/base.txt
ROS_PYTHON_VERSION=3 pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
-e git+https://github.com/ros-infrastructure/catkin_pkg.git@c6389ac1d8fdec2ffa16662c033e9f2c653e7a0d#egg=catkin_pkg
docutils==0.21.2
exceptiongroup==1.2.2
iniconfig==2.1.0
mock==5.2.0
nose==1.3.7
packaging==24.2
pluggy==1.5.0
pytest==8.3.5
python-dateutil==2.9.0.post0
six==1.17.0
tomli==2.2.1

name: catkin_pkg
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - argparse==1.4.0
      - docutils==0.21.2
      - exceptiongroup==1.2.2
      - iniconfig==2.1.0
      - mock==5.2.0
      - nose==1.3.7
      - packaging==24.2
      - pluggy==1.5.0
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - six==1.17.0
      - tomli==2.2.1
prefix: /opt/conda/envs/catkin_pkg

test/test_package.py::PackageTest::test_init_dependency
test/test_package.py::PackageTest::test_init test/test_package.py::PackageTest::test_init_kwargs_object test/test_package.py::PackageTest::test_init_kwargs_string test/test_package.py::PackageTest::test_validate_package test/test_package.py::PackageTest::test_validate_person
src/catkin_pkg/package.py
src/catkin_pkg/package.py