Specific reason for using one() or first()?  one() is going to end up fetching all row initially and then raising an exception if there's more than one result (which there shouldn't be anyway in this case)

Also I'd like to avoid \  or lines start with ., this seems cleaner:

```python

max_rank, = db.session.query(
                func.max(SoftwareVersion.rank)).filter_by(
                    software=software).one()
```